title: ammaps / amcharts using dataLoader and passing post
body: <p>Using ammaps' dataLoader, is there a way to pass post parameters to an external file?</p>
  
  <p>I'm creating a report that contains a map, which when clicked, will provide a list of news articles from a MySQL table.  I'm pulling in json data using dataLoader.  However, I need to be able to pass a value (reportId) to the script that generates the json file.  </p>
  
  <p>here's my code:  </p>
  
  <pre><code>var map = AmCharts.makeChart("mapdiv", {
    type: "map",
    "dataLoader": {
      "url": "maparticlesfeed.json.php",
      "format":"json",
      "showErrors": false//,
      // tried this:  
      //"type" : "post",
      //"data" : {"reportIdFromPost" : 1}
    },
  . . . //the rest of the map config 
  </code></pre>
  
  <p>And this is maparticlesfeed.json.php:  </p>
  
  <pre><code>&lt;?php include('database-connect.php'); 
  $con=Database::connect();
  $query=$con-&gt;prepare("SELECT * from articles Where reportId=$POST['reportIdFromPost']");
  $query=&gt;execute();
  $articlesList=$query-&gt;fetchall(PDO::FETCH_ASSOC);
  ?&gt;
  
  {
  "map" : "MyMapName",
  "_comment" : "Here, instead of hard-coding the headlines, we will iterate through $articlesList",
  "areas" : [   
      { "title" : "Virginia",
          "id" : "US-VA", 
          "selectable" : true,
          "numArticles" : 4,
          "articles" : [
              { "headline" : "This is the first headline",
                  "link" : "link url"
              },
              { "headline" : "This is the second headline",
                  "link" : "link url"
              },
              { "headline" : "This is the third headline",
                  "link" : "link url"
              },
              { "headline" : "This is the fourth headline",
                  "link" : "link url"
              }
          ]
      },
      { "title" : "Tennessee",
          "id" : "US-TN", 
          "selectable" : false,
          "numArticles" : 6
      } 
    ]
  } 
  </code></pre>