Protected Sub FormView1_DataBinding(ByVal sender As Object, ByVal e As System.EventArgs) Handles FormView1.DataBinding
Dim streetAddres As String = Nothing
Dim EventLabel As Label = FindControl("Event_locationLabel")
Dim findMap As GMap = FindControl("GMap1")
Dim GeoCode As GeoCode = Nothing
' Get user typed text from text box
streetAddres = EventLabel.Text
' pass your city name in the geo code request it return geo code
GeoCode = findMap.getGeoCodeRequest(streetAddres)
' Add the geocode in
Dim gLatLng As New GLatLng(GeoCode.Placemark.coordinates.lat, GeoCode.Placemark.coordinates.lng)
' Set center of map based on latitude and longitude coordinates
findMap.setCenter(gLatLng, 16, GMapType.GTypes.Physical)
Dim oMarker As New GMarker(gLatLng)
' Bind that marker data in google map
findMap.addGMarker(oMarker)
End Sub
错误:
Object reference not set to an instance of an object.
已调试:停止在行:streetAddres = EventLabel.Text