xelawho wrote:
> is it really necessary to have a different zoom level for each marker?
That is not what I am trying to do, all I am trying to do is have the
one zoom level for the entire map in an XML file rather than on the
page itself, because it is a template and I only would like to change
the reference to an XML file.
The code I tried is:
-------------------------------------------
var xmlDoc = GXml.parse(doc);
var markers =
xmlDoc.documentElement.getElementsByTagName("mapstyle");
for (var i = 0; i < markers.length; i++) {
// obtain the attributes for the map
var lat = parseFloat(markers[i].getAttribute("lat"));
var lng = parseFloat(markers[i].getAttribute("lng"));
var point = new GLatLng(lat,lng);
var zoom = markers[i].getAttribute("zoom");
// center and zoom the map
var mapstyle = map.setCenter(point, 5);
--------------------------------------
and that gets the lat and lng from the
http://wizz.travel/a/australia/temptest.xml
file, but I cannot get the zoom to work.
I guess it needs to be something like
var mapstyle = map.setCenter(point, "+zoom+");
Can I use setZoom for that? And if so, how? (never seen setZoom before)
--
You received this message because you are subscribed to the Google Groups
"Google Maps API V2" 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.