我已经开始使用Subgurim's Map
控件,ASP.NET
并且需要将其转换coordinates
为 astring
或类似的东西,以便我可以将其放入我的database
.
这是我的代码:
Protected Sub lnkShowMap_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkShowMap.Click Dim strFullAddress As String Dim sMapKey As String = ConfigurationManager.AppSettings("googlemaps.subgurim.net") Dim GeoCode As Subgurim.Controles.GeoCode ' Combine our address fields to create the full address. The street, ' suburb and country should be seperated by periods (.) strFullAddress = txtStreetAddress.Text & ". " & txtSuburb.Text & ". " & txtCountry.Text ' Work out the longitude and latitude GeoCode = GMap1.geoCodeRequest(strFullAddress, sMapKey) Dim gLatLng As New Subgurim.Controles.GLatLng(GeoCode.Placemark.coordinates.lat, GeoCode.Placemark.coordinates.lng) ' Display the map GMap1.setCenter(gLatLng, 16, Subgurim.Controles.GMapType.GTypes.Normal) Dim oMarker As New Subgurim.Controles.GMarker(gLatLng) GMap1.addGMarker(oMarker) ' Create coordinates in stored mem ' Dim coordinates As GeoCode = GMap1.getGeoCodeRequest(GeoCode.Placemark.coordinates) System.Diagnostics.Debug.WriteLine(coordinates) End Sub
我对此的最后两行有疑问sub
,我将其定义'coordinates'
为 的结果Gmap1's placemarker's coordinates
,但尽管在此期间debugging
, 的值GeoCode.Placemark.coordinates
并未归因于'coordinates'
这是一个截图debugging process
:
http: //www.wherelionsroam.co.uk/debug.png
我究竟做错了什么?