In the web version of Google Maps I can enter a search clue like "Borough Of Islington" and it is correctly interpreted as an area rather than a single location. The result is a faithful camera view over the London Borough Of Islington with the border clearly marked out with a red dotted line.
I am unable to reproduce this dotted area with jGoogleMaps. Using the code below the camera is correctly moved to the centre of the Borough but there is no red dotted line around the perimeter. My GoogleMaps API key is enabled for Maps Javascript API and Places API. Perhaps I am not employing the correct JSON information? Anybody tried this before?
I am unable to reproduce this dotted area with jGoogleMaps. Using the code below the camera is correctly moved to the centre of the Borough but there is no red dotted line around the perimeter. My GoogleMaps API key is enabled for Maps Javascript API and Places API. Perhaps I am not employing the correct JSON information? Anybody tried this before?
jGoogleMaps Retrieve Places:
Sub btnSearch_Click
If txtClue.Text = "" Then Return
clue = txtClue.Text.Replace(" ","%20")
Dim j As HttpJob
j.Initialize("", Me)
Dim URL As String = "https://maps.googleapis.com/maps/api/place/textsearch/json"
Dim Query As String = "?query=" & clue & "&key=" & APIkey
j.Download(URL & Query)
Wait For (j) JobDone (j As HttpJob)
If j.Success Then
Dim parser As JSONParser
parser.Initialize(j.GetString)
Dim root As Map = parser.NextObject
Dim results As List = root.Get("results")
Dim colres As Map = results.Get(0)
Dim geometry As Map = colres.Get("geometry")
Dim location As Map = geometry.Get("location")
Dim Lat,Lon As Double
Lat = location.Get("lat")
Lon = location.Get("lng")
Dim cp As CameraPosition
cp.Initialize(Lat, Lon, 17)
gMap.MoveCamera(cp)
End If
j.Release
End Sub