Sunday, February 15, 2009
additional geowankery
Google Maps can only handle KMLs with points, lines, and polys. Ground overlays are strictly verboten. However, you can overlay images in Google Maps using mapplets. The process is simple and well documented. The basic steps are:
1. write your mapplet, the example below contains all the tags that the example on google doesn't show for your cut-n-paste enjoyment:
<?xml version="1.0" encoding="UTF-8"?>
<module>
<moduleprefs title="1929 Map of San Antonio, Texas" height="300">
<require feature="sharedmap">
</require></moduleprefs>
<content type="html"><![CDATA[
<small>
This is a georeferenced map of San Antonio, Texas in 1929. The original map is at http://www.tsl.state.tx.us/arc/maps/images/map1052a.jpg
</small>
<script>
var map = new GMap2();
map.setCenter(new GLatLng(29.4208378,-98.4938900), 12);
// ground overlay
var boundaries = new GLatLngBounds(new GLatLng(29.3400022,-98.5543116), new GLatLng(29.5016733,-98.4334683))
var oldmap = new GGroundOverlay("http://www.tsl.state.tx.us/arc/maps/images/map1052a.jpg", boundaries)
map.addOverlay(oldmap)
</script>
]]></content>
</module>
2. Upload your code to a server or to Google page creator.
3. Install it on Google Maps directory.
4. Share the map using a long url like this: http://maps.google.com/ig/add?synd=mpl&pid=mpl&moduleurl=http://www.geouptime.com/mapplet_san_antonio_1929.xml
Google will ask you if you want to add it to maps (I assume it means your maps). Clicking on Add it to Maps opens the mapplet.
Voila!
Labels:
geowanking,
Google mapplet
Subscribe to:
Post Comments (Atom)
Wow, that's pretty cool! It would be really useful if you can make an image partially transparent.
ReplyDelete