Yay. been testing out your codes larry and finally I managed to get it to
work. was throwing me when it was saying overlays not defined.
After enough tweaking of realising it was the fact that:
var overlay = [];
didn't have an 's' on the end like:
overlays.push(overlay);
it helped fix the rest.
I was trying this:
var sw = new google.maps.LatLng(53.578442,-1.495214) ;
var ne = new google.maps.LatLng(53.587869,-1.4747) ;
var bounds = new google.maps.LatLngBounds(sw,ne) ;
var overlay = new ProjectedOverlay(map,'eastfield.jpg', bounds,
{percentOpacity:100}) ;
overlays.push(overlay);
for (var i=0; i < overlays.length; i++) {
overlays[i].setOpacity(desiredOpacity);
}
But desiredOpacity wasn't defining. So when i changed into its own function
like you suggested:
var sw = new google.maps.LatLng(53.578442,-1.495214) ;
var ne = new google.maps.LatLng(53.587869,-1.4747) ;
var bounds = new google.maps.LatLngBounds(sw,ne) ;
var overlay = new ProjectedOverlay(map,'eastfield.jpg', bounds,
{percentOpacity:100}) ;
overlays.push(overlay);
}
function setOpacities(desiredOpacity) {
for (var i=0; i < overlays.length; i++) {
overlays[i].setOpacity(desiredOpacity);
}
}
}
It worked and was defined. So annoying that it was something as small as an
s that kept bugging it.
if needed, working example here:
http://visualisationmagazine.com/dineography.htm
thanks again larry, would have really struggled to write the setOpacities to
keep them all controlled by the javascripts. would have needed to see it in
an example somewhere.
but again many thanks everyone.
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-maps-js-api-v3/-/SgU6P6sd2DEJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-js-api-v3?hl=en.