Hi,

Originally Posted by
firehorse
Hi,I would like to have several ezpages, each with their own map.
Could you have a javascript version that you can cut and paste into an ezpage?
Thanks
Alan
I signed up, had a look at the code and documentation
http://www.google.com/apis/maps/documentation/
After reading the documentation I started experimenting and this is what I came up with. Just cut and paste into an ezpage, and customize to your own requirements.
Put your key (from the signup) in where the abcdefg is and the rest should be self explanatory.
I only require one tab so I deleted the second tab from the original contribution. You can easily add it back in if you want the telephone number/other details on another tab.
Code:
<div class="center">
<script src="http://maps.google.com/maps?file=api&v=2&key=abcdefg"
type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
function load() {
if (GBrowserIsCompatible()) {
var GOOGLE_LAT = 37.4419;
var GOOGLE_LNG = -122.1419;
var GOOGLE_ZOOM = 13;
var STORE_NAME_ADDRESS = "Test<br />99 Road<br />Any Town<br />Any City<br />T:999 999 999";
var map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(GOOGLE_LAT, GOOGLE_LNG), GOOGLE_ZOOM);
map.addControl(new GMapTypeControl());
map.addControl(new GSmallMapControl());
map.addControl(new GOverviewMapControl());
var point = new GLatLng(GOOGLE_LAT, GOOGLE_LNG);
var infoTabs = [
new GInfoWindowTab("Address", STORE_NAME_ADDRESS)
];
var marker = new GMarker(point);
GEvent.addListener(marker, "click", function() { marker.openInfoWindowTabsHtml(infoTabs);});
map.addOverlay(marker);
marker.openInfoWindowTabsHtml(infoTabs);
}
}
//]]>
</script>
</head>
<body onload="load()" onunload="GUnload()">
<div id="map" style="width: 500px; height: 300px"></div>
</div>
Best regards
Alan