søndag den 24. januar 2010

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

Lad din URL tematiserer dit kort ...

Let your URL thematically create your map ...


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)


The URL obtained is :


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

Ingen kommentarer:

Send en kommentar