Semantic Google Maps with kml?
Jeroen, for a documentation site on landgrabbing issues I managed to set up a semantic mediawiki (1.17) including semantic maps (1.03). Forms and a results map have been straightforward to implement, but now I have been asked if we could display the contents of a kml or kmz file in such a map. I have tried to understand the maps code (I am not really good in php), but I found no real entry point or hint that this is implemented in semantic google maps. From my understanding, it however seems to have been implemented in the normal mediawiki google maps.
Could you please shed some light on this?
If you use Google Maps v3 as service (which is the default), then you can add kml and kmz files using the kml and gkml parameters. These are accepted by display_map, display_points and semantic queries with format map or googlemaps.
{{
#ask: ABQIAAAAaufLn-pud1u2U6PL9te-BBTSCke0pf_Q3FbnK4iLZ8CjvGATgBSyLJTPlQhtdtcsHoxC4sdYWbv3IQ
[[Category:DemoLandgrab]]
| ?Has GeoKoordinaten
| ?GeoKoordinaten
| ?kml=http://wiki.space2live.org/mw/images/4/44/Ashaninka.kml
| format=map
}}
This is what I do so far - it displays the map with the places from the DemoLandgrab category if they have coordinates. I thought I could add the kml coordinates to this map - visible only when zooming in. But I would be at least as happy with a map showing only the kml outline, I just couldn't find out the syntax how to accomplish that.
The KML parser of Semantic Maps does not support the LinearRing element, so it, and all the point it contains, are getting dropped. You can try the gkml param instead, which sends the KML to Google services and get the tiles from there.
Thanks, Jeroen. I couldn't get it to work immediately, but will try again tomorroy. Additionally I found your blog plus some documentation on referata.com, which will probably help.
Thanks again, also for this excellent extension to MediaWiki
Markus