In my selectPlace() function (when click at map), I got lat and lng and placeId. I want to use place detail information, but I can not send a request.
How can I do that?
Here is my code:
<GmapMap
:center=center
ref="mapRef"
:zoom="17"
map-type-id="terrain"
class="image is-4by3"
style="width: 100%;"
@click="selectPlace"
>
....
selectPlace (map) {
this.place.latitude = map.latLng.lat()
this.place.longitude = map.latLng.lng()
var placeService = new this.google.maps.places.PlacesService(map)
var request = { placeId: map.placeId }
placeService.getDetails(request, function (results, status) {
if (status === 'OK') {
if (results[0]) {
alert(results[0].formatted_address)
} else {
window.alert('No results found')
}
}
})
}
In my selectPlace() function (when click at map), I got lat and lng and placeId. I want to use place detail information, but I can not send a request. How can I do that?
Here is my code: