Hi,

I've got the following problem.
I want to use the geocoding and polygon-drawing abilities of google
maps.
But i use web-user-controls so I can't put the javascript on the page
it self.
I use RegisterStartupScript to get the java to the clientside.

This works in IE (6) but it won"t work in Firefox.
In FF I see the google maps control but the geocoding didn't take
place, so the map is all gray.
Can anybody tell me what I need to change to get it working in FF?

Thnx in advance!

Code :
Dim sb As String = ""

            sb = sb & "<script language=""JavaScript"" type=""text/
javascript"">"
            sb = sb & vbCrLf
            sb = sb & "window.onload = initialize();"
            sb = sb & vbCrLf
            sb = sb & "var map = null;"
            sb = sb & "var geocoder = null;"

            sb = sb & "function initialize() {"
            sb = sb & "if (GBrowserIsCompatible()) {"
            sb = sb & "map = new GMap2(document.getElementById
('map_canvas'));"
            sb = sb & "map.addControl(new GMapTypeControl()); "
            sb = sb & "map.addControl(new GLargeMapControl()); "
            sb = sb & "map.addControl(new GScaleControl()); "
            sb = sb & "geocoder = new GClientGeocoder();"
            sb = sb & "}"
            sb = sb & "}"
            sb = sb & ""
            sb = sb & "function showAddress(address) {"

            sb = sb & "geocoder = new GClientGeocoder();"
            sb = sb & "if (geocoder) {"

            sb = sb & "geocoder.getLatLng("
            sb = sb & "address,"
            sb = sb & "function(point) {"

            sb = sb & "if (!point) {"
            sb = sb & "alert(address + ' not found');"
            sb = sb & "} else {"
            sb = sb & "map.setCenter(point, 13);"

            sb = sb & "var marker = new GMarker(point);"
            sb = sb & "map.addOverlay(marker);"
            sb = sb & "var polygon = new GPolygon(["
            Select Case rblRadio.SelectedValue
                Case 1
                    '** 100
**********************************************************
                    sb = sb & "new GLatLng(point.y - 0.0045 , point.x
- 0.000715),"
                    sb = sb & "new GLatLng(point.y + 0.0045, point.x -
0.000715),"
                    sb = sb & "new GLatLng(point.y + 0.0045, point.x +
0.000715),"
                    sb = sb & "new GLatLng(point.y - 0.0045, point.x +
0.000715),"
                    sb = sb & "new GLatLng(point.y - 0.0045 , point.x
- 0.000715)"
                Case 2
                    '** 500
**********************************************************
                    sb = sb & "new GLatLng(point.y - 0.0045 , point.x
- 0.003575),"
                    sb = sb & "new GLatLng(point.y + 0.0045, point.x -
0.003575),"
                    sb = sb & "new GLatLng(point.y + 0.0045, point.x +
0.003575),"
                    sb = sb & "new GLatLng(point.y - 0.0045, point.x +
0.003575),"
                    sb = sb & "new GLatLng(point.y - 0.0045 , point.x
- 0.003575)"
                Case 3
                    '** 1000
**********************************************************
                    sb = sb & "new GLatLng(point.y - 0.0045 , point.x
- 0.00715),"
                    sb = sb & "new GLatLng(point.y + 0.0045, point.x -
0.00715),"
                    sb = sb & "new GLatLng(point.y + 0.0045, point.x +
0.00715),"
                    sb = sb & "new GLatLng(point.y - 0.0045, point.x +
0.00715),"
                    sb = sb & "new GLatLng(point.y - 0.0045 , point.x
- 0.00715)"
                Case 4
                    '** 2000
**********************************************************
                    sb = sb & "new GLatLng(point.y - 0.0045 , point.x
- 0.0143),"
                    sb = sb & "new GLatLng(point.y + 0.0045, point.x -
0.0143),"
                    sb = sb & "new GLatLng(point.y + 0.0045, point.x +
0.0143),"
                    sb = sb & "new GLatLng(point.y - 0.0045, point.x +
0.0143),"
                    sb = sb & "new GLatLng(point.y - 0.0045 , point.x
- 0.0143)"
            End Select
            sb = sb & "], '#f33f00', 5, 1, '#ff0000', 0.2);"
            sb = sb & "map.addOverlay(polygon);"

            sb = sb & "}"
            sb = sb & "}"
            sb = sb & ");"
            sb = sb & "}"
            sb = sb & "}"
            sb = sb & "</script> "

            sb = sb & "<script language=""JavaScript"" type=""text/
javascript"">"
            sb = sb & vbCrLf
            sb = sb & "showAddress('" & txtRadio.Text & "');"
            sb = sb & "</script> "
            ScriptManager.RegisterStartupScript(Page, Page.GetType,
"GeoMap", sb.ToString(), False)

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to