Sunday, January 24, 2010

MapsGeek.com is a free website designed to allow anyone to easily create thematic maps


Lad din URL tematiserer dit kort ...
/Sik


Let your URL thematically create your map ...
/Sik


Quote

Equipped with a powerful blend of features, MapsGeek will guide you in the map's making and let you publish this map on your website, blog to illustrate your articles. Create, import or select your layers, add your data, tune the display and you're done !


Live data maps

Fri Jan 22, 2010 at 19:59

A grand new feature on MapsGeek today: the live mapping. In two words, the live mapping allow you to include the data to be mapped directly into the url used to call the map from your website! This allow data present on your website to be mapped live! Have a look at our example. Live mapping is available for everyone from the map interface for all geometrical layers.


The following map is generated live from this page. It shows the countries MapsGeek users are from. This page gathers the information, builds the URL and display the map.

Generating the script to build this map

The URL has to contain the following information :

  • The map parameter, which is gvux92r58surqfkx for this map, you'll find this information on the Map Interface
  • The l1 parameter, the live layer id, 1023 in our case, again found on the Map Interface
  • The dl1 parameter, the data for the layer, generated by this page and using the following format: object1:value1;object2:value2;...
This page is written in PHP, here is the full script to generate this map:
// The base URL containing the map and l1 parameters and introducing the dl1
$url = "http://www.mapsgeek.com/live.php?map=gvux92r58surqfkx&l1=1023&dl1=";

// The query to gather the information
$query = "select COUNTRY, count(USERS) NBU from USERS group by COUNTRY";
$dbresult= mysql_query($query, $connection_to_database);

// The loop building the dl1 parameter
while($row = mysql_fetch_array($dbresult, MYSQL_ASSOC))
{
$obj = urlencode($row[COUNTRY]); //Encoding the country name, storing in $obj
$val = $row[nbu]; //Storing the number of users into $val
$url .= "$obj:$val;"; //Adding the $obj (country), followed by ':', the $val (number of users), ended by ';'
}

// Displaying the url obtained inside an image tag (and a link to mapsgeek page also)
print("");

?>


The URL obtained is :

http://www.mapsgeek.com/live.php?map=gvux92r58surqfkx&l1=1023&dl1=Argentina:2;Australia:5;Austria:1;Barbados:1;Belgium:6;Bolivia:1;Brazil:1;Bulgaria:1;Cameroon:1;Canada:9;China:1;Croatia:1;Czech+Republic:1;Ecuador:1;Faroe+Islands:1;Finland:1;France:75;Germany:3;Hungary:3;India:7;Indonesia:2;Ireland:1;Italy:7;Kuwait:1;Malaysia:1;Mali:1;Martinique:1;Mayotte:1;Mexico:1;Montserrat:1;Morocco:1;Netherlands:4;Nicaragua:1;Norway:1;Pakistan:1;Philippines:1;Portugal:2;Russia:1;Serbia:1;Spain:1;Switzerland:1;United+Kingdom:15;United+States:107;Venezuela:1;


Read more: http://www.mapsgeek.com/

No comments:

Post a Comment