Hi Martin,
I'm having a little difficulty getting my head round the oldZoom and
newZoom parameters
Is this aspect related to the reference in geocodezip's example link:
var currentZoom = map.getZoom();
// alert("currentZoom="+currentZoom);
var newZoom = 1;
if (currentZoom < 4) {
newZoom = 4;
map.setCenter(marker.getPoint(), newZoom);
} else if (currentZoom < 7) {
newZoom = 7;
map.setCenter(marker.getPoint(), newZoom);
} else {
newZoom = currentZoom;
- i think this is missing from my site - any chance you can show me
how it would apply to my code below:
var markers = xmlDoc.documentElement.getElementsByTagName
("regional_markers");
for (var i = 0; i < markers.length; i++) {
// obtain the attribues of each marker
var lat = parseFloat(markers[i].getAttribute
("lat"));
var lng = parseFloat(markers[i].getAttribute
("lng"));
var point = new GLatLng(lat,lng);
var label = markers[i].getAttribute("name");
var minZoom = parseFloat(markers[i].getAttribute(
"minzl" ) );
var maxZoom = parseFloat(markers[i].getAttribute(
"maxzl" ) );
//GLog.write('name ' + label + ' min ' + minZoom + '
max ' +
maxZoom);
var reg_id = markers[i].getAttribute("id");
var nat_id = markers[i].getAttribute("nat_id");
//GLog.write(title);
//GLog.write(photo);
// === read the icontype attribute ===
var icontype = markers[i].getAttribute
("icon");
//GLog.write(icontype);
// === create the marker, passing the icontype
string ===
var marker = createMarker
(point,label,infotitle,html,icontype,maxZoom); //
'infotitle,html,' - need to be present otherwise the regional icons
won't display -- very weird!
//map.addOverlay(marker);
markerManager.addMarker(marker,minZoom,maxZoom);
}
Cheers
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
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-API?hl=en
-~----------~----~----~----~------~----~------~--~---