I have Google Maps on my website, which works perfect in IE but not in FireFox. The map initializes and displays the first map (by long/lat coordinates) in FireFox, but then won't change maps after user selects new address.
This is in the Head Section:
function initialize() {
if (GBrowserIsCompatible()) {
map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(43.75, -79.27), 15);
map.setUIToDefault();
geocoder = new GClientGeocoder();
}
}
function showAddress() {
var txtAddress = document.getElementById("<%=Label10.ClientID %>");
var txtCompany = document.getElementById("<%=Label3.ClientID %>");
var address = txtAddress.innerText;
var company = txtCompany.innerText;
geocoder.getLatLng(
address,
function (point) {
if (!point) {
// alert(address + " not found");
}
else {
map.setCenter(point, 15);
var marker = new GMarker(point);
map.addOverlay(marker);
marker.openInfoWindow(address);
}
}
);
}
In my .aspx.vb (server side code behind) page, I then call the showAddress function like so,
Response.Write("<script language = javascript>")
Response.Write("showAddress();")
Response.Write("</script>")
.... Again, this works fine in IE, but not in FireFox.
I also tried this, but it just causes the site to freeze...
Dim cstext1 As New StringBuilder
cstext1.Append("<script type=text/javascript> showAddress() </")
cstext1.Append("script>")
Member
1 Points
41 Posts
Google Maps Not Working In FireFox
Apr 02, 2010 10:05 PM|acaunter|LINK
ASP.Net 1.1 / 2003
I have Google Maps on my website, which works perfect in IE but not in FireFox. The map initializes and displays the first map (by long/lat coordinates) in FireFox, but then won't change maps after user selects new address.
This is in the Head Section:
In my .aspx.vb (server side code behind) page, I then call the showAddress function like so,
Response.Write("<script language = javascript>")
Response.Write("showAddress();")
Response.Write("</script>")
.... Again, this works fine in IE, but not in FireFox.
I also tried this, but it just causes the site to freeze...
Dim cstext1 As New StringBuilder
cstext1.Append("<script type=text/javascript> showAddress() </")
cstext1.Append("script>")
RegisterStartupScript("Map", cstext1.ToString())
Please Help!