Let me share to you code with version 3. Hope it helps to you.
I'm using dojo framework to show the map embedded in a Dialog window.
"map_canvas" --> is my DIV to contain and display the map.
url: "/t3TrackingServlet?OT="+Ot --> is a Servlet where my json code
is generated.
json is structured like this example:
{ "markers": [
{"label":"marker1",
"point"::new google.maps.LatLng( latitudValue, longitudValue)}
]
}
Javascript code:
function initMaps(Ot) {
var myOptions = {
zoom: 5,
center: new google.maps.LatLng(25, -100),
mapTypeId: google.maps.MapTypeId.ROADMAP,
mapTypeControl: true,
mapTypeControlOptions: {
style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
},
zoomControl: true,
zoomControlOptions: {
style: google.maps.ZoomControlStyle.SMALL
}
};
map = new
google.maps.Map(document.getElementById("map_canvas"), myOptions);
var req = {
url: "/t3TrackingServlet?OT="+Ot,
handleAs: "json",
sync:true,
load: function (data) { getDataMaps(data); },
error: function (error){
alert("Error(getLayouts): "+error.message); }
};
dojo.xhrGet(req);
};
function getDataMaps(info) {
var marker = null;
var bounds = new google.maps.LatLngBounds();
for (var i=0; i<info.markers.length; i++) {
marker = new google.maps.Marker({
position: info.markers[i].point,
map: map,
title: info.markers[i].label
});
bounds.extend(info.markers[i].point);
}
map.fitBounds(bounds);
};
Regards,
Carlos Montelongo
2012/1/26, Chandra Miller <[email protected]>:
> I am trying to migrate my v2 map at
> http://156.42.96.39/alert/Google/streamflow.html
> to v3. The main reason is so I can have the infowindow tabs work on
> tablets and smartphones.
>
> Here is the link to the map I am working on
> http://156.42.96.39/alert/Google/roads_test.html
> (its a work in progress - been messing around with the infowindow
> tabs).
>
> I need help getting the map to load the roadwl.js and read
> http://156.42.96.39/alert/Google/xml/fcdmc_alert_roadwl.xml for the
> lat, long, stage, etc. The map markers display data from our stream
> gages and show current discharge values. The function load ( ) that I
> used in V2 isn’t working and I cant find any other examples like my
> maps (everything in pie at
> http://www.fcd.maricopa.gov/Rainfall/rainfall.aspx).
> The GDownloadUrl("xml/fcdmc_alert_roadwl.xml is with the .js file -
> map. Please Help!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Maps JavaScript API v3" 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-js-api-v3?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" 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-js-api-v3?hl=en.