Here's the code that I have input into its own Content block to hand code for each page now:
Code: Select all
{literal}
<__script__ type="text/javascript">
//<![CDATA[
var geocoder;
var map;
var address = "345 Anywhere Street East, Smalltown, ON, M4Z 3Z6";
var name = "A Great Place to Be"
var url = 'http://maps.google.com/?q=' + name + address + '&z=16&t=m';
function load()
{
if (GBrowserIsCompatible()) {
map = new GMap2(document.getElementById("map"));
geocoder = new GClientGeocoder();
geocoder.getLocations(address, addToMap);
map.addControl(new GSmallMapControl()); }
}
function addToMap(response)
{
place = response.Placemark[0];
point = new GLatLng(place.Point.coordinates[1],
place.Point.coordinates[0]);
marker = new GMarker(point);
map.setCenter(point, 15);
map.addOverlay(marker);
GEvent.addListener(marker, "click", function() {
window.open(url, "_blank","menubar=yes,scrollbars,resizable=yes,width=640,height=480");});
}
//]]>
</__script>
{/literal}
<div id="map"></div>
Code: Select all
<div id="hidden">{content block="name" assign=name oneline='true' wysiwyg='false'}</div>
<div id="hidden">{content block="address" assign=address oneline='true' wysiwyg='false'}</div>
<div id="hidden">{content block="city" assign=city oneline='true' wysiwyg='false'}</div>
<div id="hidden">{content block="postalcode" assign=postalcode oneline='true' wysiwyg='false'}</div>
{googleMap name="$name" address="$address" city="$city" postalcode="$postalcode"}
Many thanks in advance.
Wayne
