One of the great features of Google Maps API, is the possibility to easily display Point Of Interest (POI’s) on top of the maps.
Included in Google Map API V2 is the GLayer function that makes it very easy to display data from Wikipedia and Panoramio as layers on your Google Map API based maps.
In this post we’ll create a script that uses the GLayer functionality to display POI’s on your map.
Google Map API has just been launched in V3, so why is this post based on a solution on Google Map API V2?.
The V3 of Google Map API was launched May 19th 2010, however there is still a lot of functionality from the V2 version that hasn’t been included in the V3 version, including GLayer, so we’ll base this post on the V2 API, since the V3 API doesn’t seem to be fully developed yet (but it does look promising)
With the GLayer functionality you can add some POI themes, that is stored and maintained by Google. Since maintaining POI data can be quite some work, this is a great service.
Currently the GLayer supports POI data from sources like Wikipedia and Panoramio. You can see the full list of data sources and supported languages in the table below:
|com.panoramio.all||All photos from panoramio.com|
|org.wikipedia.ar||ar||Geotagged Wikipedia articles (Arabic)|
|org.wikipedia.bg||bg||Geotagged Wikipedia articles (Bulgarian)|
|org.wikipedia.ca||ca||Geotagged Wikipedia articles (Catalan)|
|org.wikipedia.cs||cs||Geotagged Wikipedia articles (Czech)|
|org.wikipedia.da||da||Geotagged Wikipedia articles (Danish)|
|org.wikipedia.de||de||Geotagged Wikipedia articles (German)|
|org.wikipedia.el||el||Geotagged Wikipedia articles (Greek)|
|org.wikipedia.en||en||Geotagged Wikipedia articles (English)|
|org.wikipedia.es||es||Geotagged Wikipedia articles (Spanish)|
|org.wikipedia.eu||eu||Geotagged Wikipedia articles (Basque)|
|org.wikipedia.fi||fi||Geotagged Wikipedia articles (Finnish)|
|org.wikipedia.fr||fr||Geotagged Wikipedia articles (French)|
|org.wikipedia.gl||gl||Geotagged Wikipedia articles (Galician)|
|org.wikipedia.he||he||Geotagged Wikipedia articles (Hebrew)|
|org.wikipedia.hr||hr||Geotagged Wikipedia articles (Croatian)|
|org.wikipedia.hu||hu||Geotagged Wikipedia articles (Hungarian)|
|org.wikipedia.id||id||Geotagged Wikipedia articles (Indonesian)|
|org.wikipedia.it||it||Geotagged Wikipedia articles (Italian)|
|org.wikipedia.ja||ja||Geotagged Wikipedia articles (Japanese)|
|org.wikipedia.lt||lt||Geotagged Wikipedia articles (Lithuanian)|
|org.wikipedia.lv||lv||Geotagged Wikipedia articles (Latvian)|
|org.wikipedia.nl||nl||Geotagged Wikipedia articles (Dutch)|
|org.wikipedia.nn||nn||Geotagged Wikipedia articles (Norwegian/Nynorsk)|
|org.wikipedia.no||no||Geotagged Wikipedia articles (Norwegian/Bokmal)|
|org.wikipedia.pl||pl||Geotagged Wikipedia articles (Polish)|
|org.wikipedia.pt||pt||Geotagged Wikipedia articles (Portuguese)|
|org.wikipedia.ru||ru||Geotagged Wikipedia articles (Russian)|
|org.wikipedia.sk||sk||Geotagged Wikipedia articles (Slovak)|
|org.wikipedia.sl||sl||Geotagged Wikipedia articles (Slovenian)|
|org.wikipedia.sv||sv||Geotagged Wikipedia articles (Swedish)|
|org.wikipedia.th||th||Geotagged Wikipedia articles (Thai)|
|org.wikipedia.tr||tr||Geotagged Wikipedia articles (Turkish)|
|org.wikipedia.uk||uk||Geotagged Wikipedia articles (Ukrainian)|
|org.wikipedia.vi||vi||Geotagged Wikipedia articles (Vietnamese)|
Display Wikipedia and Panoramio on your map
To display Wikipedia and Panoramio data as layers on the map, I have modified a script from econym.org.uk.
The final script displays data from Panoramio, Wikipedia (english) and Public webcams.
With 3 POI’s, a map can be very busy to look at – therefore this scrips has a POI control, labeled “More”, where the user can easily switch the layers on/off as he or she likes.
Just click the “More” button in the example to play around with the different layers.
As you see from the source code it’s pretty easy to get up-and-running, displaying POI’s on Google Map API V2.
I really hope the GLayer functionality will soon be included in V3 of the API since this is a very useful feature.