Hi there, I have the following code:
var centerlat = 51.343225268175;
var centerlng = -4.34317803278;
var googleMap = null;
var previousPos = null;
var MIN_ZOOM_LEVEL = 19;
var MAX_ZOOM_LEVEL = 21;
$(function($){//Called when page is loaded
googleMap = new google.maps.Map(document.getElementById("map_canvas"), {
zoom: MIN_ZOOM_LEVEL,
center: new google.maps.LatLng(centerlat, centerlng),
mapTypeId: google.maps.MapTypeId.ROADMAP });
var tester = [
new google.maps.LatLng(51.343225268175, -4.3430012489791 ),
new google.maps.LatLng(51.343243810758, -4.3430751462413 ),
new google.maps.LatLng(51.343018092925, -4.3431956226451 ),
new google.maps.LatLng(51.342999072325, -4.3431318564872 ),
new google.maps.LatLng(51.343225268175, -4.3430012489791 )
];
testerpoly = new google.maps.Polygon({
paths: tester,
strokeColor: "#FF0000",
strokeOpacity: 0.8,
strokeWeight: 3,
fillColor: "#FF0000",
fillOpacity: 0.35
/////////////////////////THIS BIT PLZ HELP!!!/////////////////////////
freetext: "blah"
//////////////////////////////////////////////////////////////////////
});
testerpoly.setMap(googleMap);
google.maps.event.addListener(testerpoly, 'click', showArrays);
infowindow = new google.maps.InfoWindow();
function showArrays(event) {
// Content string bit
var contentString = "<b>Poly Clicked!</b><br />" + freetext; ///////// THIS BIT TOO!!
// Replace our Info Window's content and position
infowindow.setContent(contentString);
infowindow.setPosition(event.latLng);
infowindow.open(googleMap);
}
});//onload
//]]>
For some reason the "freetext" variable is not being translated to the showArrays function... I expect that this is a fairly simple thing to resolve and would very much appreciate your help!
Thanks,
tozj.