The Google map hack is an example of using XML and AJAX technologies. This demonstration could be done without using AJAX technology, but would be very messy!
<script src="http://maps.google.com/maps?file=api&v=1&key=ABQIAAAAuD2gAhf0ynt85U6Fmn8TPRRtjE1vMfVqPnDWLnGITQ_HRSZ3zRQq8nRCupNIsAJ6alr9JKMAtwz0_g" type="text/javascript"></script>
<script type="text/javascript"
src="gmaploader.js"></script></code>
<div id="map" style="width: 600px; height: 600px"><div>
<script type="text/javascript">
loadMap("map_data.xml","map");
</script>
The file is formatted as follows:
<?xml version="1.0"?> <map> <markers> <marker></marker> … </markers< </map>
lat |
required |
The latitude where the map should be centered. |
lng |
required |
The longitude where the map should be centered. |
zoom |
required |
The zoom level (1-8) |
view |
optional |
« SATELLITE » for a satellite view; defaults to the « roads » view. |
iconUrl |
required |
The url of the icon to be used for markers. |
iconWidth |
required |
The width of that marker icon. |
iconHeight |
required |
The height of that marker icon. |
This element contains HTML content that should show up in the marker’s info window when the icon is clicked. Be careful to escape characters to XML entities (i.e. the tag ‘p’ should become ‘<p>’’).
Attributeslat |
required |
The latitude where the marker should be placed. |
lng |
required |
The longitude where the marker should be placed. |
iconUrl |
required |
The url of the icon to be used for this marker; if not defined, defaults to the value in the <map> element. |
iconWidth |
required |
The width of this marker icon; if not defined, defaults to the value in the <map> element. |
iconHeight |
required |
The height of this marker icon; if not defined, defaults to the value in the <map> element. |
<?xml version="1.0"?> <map lat="27.553539" lng="88.482084" zoom="7" view="SATELLITE" iconUrl=" http://www.someurl.edu/marker.png" iconWidth="12" iconHeight="20"> <markers> <marker lat="27.323256" lng="88.603020" iconUrl="http://www.url.edu/icon1.png" iconWidth="31" iconHeight="52"> Gangtok <i>This is a great place to visit in the winter.</i> </marker> >marker lat="27.37278" lng="88.2205">Yuksam</marker> </markers> </map>
Create a new map and annotate it. Your map could do a number of things: