0
votes

I am using Google Map in order to display geolocation information.

The workflow for user is:

  1. fill the address in the single field with auto completion and show the location on the map.
var autocomplete = new google.maps.places.Autocomplete(input);
...
google.maps.event.addListener(autocomplete, 'place_changed', function() { 
...
google.maps.event.addListener(marker, "dragend", function() {
  1. If on the current step we cannot precisely identify the location (precisely means I do know the country/city/street/number, in short precise location) by entered string, suggest the user to enter city/street/number in separate fields.

The problem is I don't know how to define the event whether the location is defined precisely or not, thus if I enter Germany in location field it already is going to define the location (longitude and latitude somewhere in Germany) and place the marker on it, however it's not the precise location.

Do you know how to define thee precise location event and how to catch it?

1

1 Answers

0
votes

You can check when there is a road at that point. Then you can know precisely but you need to know a start point. With a start point and the direction service you can find the point precisely.