-
Google Map bug perhaps u can help
Im using Google API, and when trying to set from geocoding an address I get browser problems... ive also wrapped everything in updatepanels
Anyone have any solution, I've put it up at
Used url shortener to obfiscate url from a (mostly public) listing until Ive completed project.
http://www.tiny.cc/googlemapproblem
You can see my problem.
I am seeing the map if I click the search button twice. But it promptly dissapears.
Code:
Protected Sub btnSearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSearch.Click
'key
Dim GMapKey As String = "your_api_key_here_removedforsecurity"
Try
Dim gmapRequest As String = "http://maps.google.com/maps/geo?key=" & GMapKey & "&q=" & txtSearchAddress.Text & "," & txtSearchCity.Text & "," & drpSearchState.SelectedItem.ToString & "&sensor=false&output=xml"
Dim results As GMapGeocoder.Containers.Results = GMapGeocoder.Util.Geocode(txtSearchAddress.Text & "," & txtSearchCity.Text.ToString & "," & drpSearchState.SelectedItem.Text.ToString & " " & txtSearchZip.Text.ToString, GMapKey)
Dim match1 As GMapGeocoder.Containers.USAddress = results.Addresses(0)
Dim city As String = match1.City
Dim state As String = match1.StateCode
Dim lat As Double = match1.Coordinates.Latitude
Dim lon As Double = match1.Coordinates.Longitude
Dim resstr As String = match1.FullText & match1.Accuracy.ToString
lblResult.Text = "debug on: " & lat & "," & lon & "<br/>" & resstr
lblResultLeft.Text = lat & "," & lon
'Build script here
'js.Text = "<script type=""text/javascript"">" & _
' "function initialize() {" & _
' " //-34.397, 150.644 " & _
' " var latitude = " & lblResultLeft.Text & _
' " //var longitude = document.getElementById(""lblResultLeft"") " & _
' " var latlng = new google.maps.LatLng(latitude); " & _
' " var myOptions = { " & _
' " zoom: 8," & _
' " center : latlng, " & _
' " mapTypeId : google.maps.MapTypeId.ROADMAP() " & _
' " }; " & _
' " var map = new google.maps.Map(document.getElementById(""map_canvas""), myOptions); " & _
' " } " & _
' "</script> "
'js.Text = "<script type='text/javascript'>" & vbCrLf & _
' " initialize();" & vbCrLf & _
' "</script>"
btnSearch.OnClientClick = "javascript:initializesetmap(" & lblResultLeft.Text & ");"
Catch ex As Exception
End Try
End Sub
Unsure how I can fix this... Any ideas?
Similar Threads
-
Replies: 4
Last Post: 09-11-2009, 01:45 PM
-
Replies: 0
Last Post: 06-16-2008, 08:57 AM
-
By alsoares in forum AJAX
Replies: 2
Last Post: 12-20-2007, 08:03 PM
-
Replies: 3
Last Post: 05-16-2007, 03:06 PM
-
By mark hembree in forum ASP.NET
Replies: 1
Last Post: 01-11-2001, 11:21 AM
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|