Difference between revisions of "Google Maps"
(→Creating a custom popup box using the overlay method: source example) |
(Selecting markers with SMW queries) |
||
| Line 78: | Line 78: | ||
<br /> | <br /> | ||
[[File:AjaxMap - icons and data.jpg|500px]] | [[File:AjaxMap - icons and data.jpg|500px]] | ||
| + | |||
| + | == Selecting markers with SMW queries == | ||
| + | [[File:AjaxMaps - query.jpg|500px]] | ||
== Finishing up == | == Finishing up == | ||
Revision as of 16:53, 18 January 2012
This was job which I did at the beginning of 2012 for Trail WIKI, I'm documenting it here because it involved many different interesting aspects and also included some useful information which will help with later jobs.
The wiki contains many pages which represent hiking trails. It uses an infobox template to that various information about each trail such as its distance, elevation and other attributes can be contained in a structured way in the article.
On the main page is a Google map which has markers for all the trails, and when one is clicked a popup is revealed containing a link to the associated trail article.
The client wanted to have this map functionality extended such that the infobox that pops up is customised to the style of the site and contains some of the key information from the trail article's infobox. Also he wanted to use the Semantic Maps extension so that he could have other maps throughout the wiki which shows only very specific sets of markers such as trails with a certain region or above a certain elevation.
Another issue is that the wiki will eventually contain thousands of trails, so the maps need to load the trail location data after the page has loaded, and the popup boxes in the markers need to load their content on-demand too.
Contents
Semantically annotating the infobox template
Retrieving the location data via AJAX
Creating a custom popup box using the overlay method
I started with this script from the exampled in the Google documentation.




