Webmastersite.net
Register Log In

Google Maps Integration

Title Google Maps Integration
Description show a map location for an item
Message Text 1) Get your google maps API key at http://www.google.com/apis/maps/signup.html
2) At Admin -> Customizations -> Add Fields, add this setting field: googlemapskey
3) At Admin -> Customizations -> Add Fields, add these link fields (as text): lat, long
4) Copy your key into the admin panel where the googlemapskey field has been added (should be at the bottom of Admin -> Settings -> General if I recall).
5) In your wrapper template, change your <body> tag to this:
<body onload="load()" onunload="GUnload()">
6) Place this where you want to show the map (presumably your 'link details' template):

<IF {LINKLAT} and {LINKLONG}>
<script src="http://maps.google.com/maps?file=api&v=2&key={GOOGLEMAPSKEY}"
type="text/javascript"></script>
<script type="text/javascript">

//<![CDATA[

function load() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng({LINKLAT}, {LINKLONG}), 13);
}
}

//]]>
</script>

<div id="map" style="width: 500px; height: 300px"></div>
</IF>

7) Type in lattitude and longitude values for the desired links. Example lat and long: 37.4419, -122.1419
Rating
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5
0/5 based on 0 votes.
Ownership Paul
Views 905 views. Averaging 0 views per day.
Similar Topics
Submission Date Mar 09, 2007 - 12:54 AM