Limit search in geolocalization

  • Chabi01
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
7 years 9 months ago #10493 by Chabi01
Limit search in geolocalization was created by Chabi01
Hi Dima ! (Hi everybody :)

I have a question related to the geolocalization on maps. I don't know if this is possible or not, but i ask :)
On a map, i can activate a field to type an address to geolocalize a point on the map.
As i use this field to help people finding an address on a specific city, i was wondering if this is possible to restrict the search area. I explain myself :
- Imagine i have a city (Paris). I search for "rue des lilas"
The result in Googlemap (the site) give 5 possibilities : Paris, Bordeaux, etc..
Now, if the person type in the field (ZHGooglemap) "Rue des lilas Paris", it works.
But the person doesn't think to add the city in the field and the results are then inacurate...
Do i have a possibility to :
- restrict the search to a specific city ?
- autocomplete the search field by adding the city and postcode (maybe by modifying a file ?)

Thanks :)
Xavier

Please Log in or Create an account to join the conversation.

  • Chabi01
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
7 years 9 months ago #10494 by Chabi01
Replied by Chabi01 on topic Limit search in geolocalization
Another idea !
If i create a form (BreezingForms or Chronoforms in example) with a dropdown of all road in a specific city, can i send the choice to zhgooglemap ? It can be a solution also...

Please Log in or Create an account to join the conversation.

More
7 years 9 months ago #10495 by Dima
Replied by Dima on topic Limit search in geolocalization
Hi.
If you use field Find by geocoding you can:
1 - restrict search result to country
2 - you can add to this field autocomplete feature by enabling places + set autocomplete to true
3 - for enabled autocomplete feature you can also add restriction to search.

Here FAQ how create autocomplete wiki.zhuk.cc/index.php/Zh_GoogleMap_FAQ#...h_Autocomplete_field

As for this docs - I'll fix demo examples, because it is old version of links (links don't work)

As for restriction:
- find button
wiki.zhuk.cc/index.php/Zh_GoogleMap_Description#Map_Controls
Go to "Search region" property

- autocomplete
wiki.zhuk.cc/index.php/Zh_GoogleMap_Desc...Using_Places_Library
Go to "Search country" property

Don't forget support my developments: post review in JED , donate , help with translation ;)

Please Log in or Create an account to join the conversation.

More
7 years 9 months ago #10496 by Dima
Replied by Dima on topic Limit search in geolocalization

Don't forget support my developments: post review in JED , donate , help with translation ;)

Please Log in or Create an account to join the conversation.

  • Chabi01
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
7 years 9 months ago #10497 by Chabi01
Replied by Chabi01 on topic Limit search in geolocalization
Hi Dima,
Thanks for the example.
Even with this explanation, it's not completly clear for me (sorry Dima ! :)

I did this :
Activate place library : yes
Place types : empty
Radius : 0
Show autocomplete field : yes
Autocomplete field width : 70
Place type for autocomplete field : empty
Show direction : no
Search country : FR

In the Map controls, i have :
Find controls : Yes
Find controls width : 200
Draw route : non
Change zoom for result : 15
Search Region : FR

All this give me the autocompletion in the field (that's already great !).
The things i don't understand :
- can i limit to a specific city ? Can i avoid showing place outside of my city (to prevent to go "out" of the map) ?
- How to use the restriction in autocomplete (as i want only street names) ?

Thanks again for your time Dima :)
Note : the width for search is gave in map control and place library, which one do i have to use ?

Please Log in or Create an account to join the conversation.

More
7 years 9 months ago #10500 by Dima
Replied by Dima on topic Limit search in geolocalization
The Google Maps API allow restrict only by country. You can't restrict by region or city.
I tried to use bounds option for autocomplete field, but it doesn't work as I expect. It is not restrict.
In google's docs the same
"bounds
Type: LatLngBounds|LatLngBoundsLiteral
The area in which to search for places. Results are biased towards, but not restricted to, places contained within these bounds."

Don't forget support my developments: post review in JED , donate , help with translation ;)

Please Log in or Create an account to join the conversation.

Time to create page: 0.326 seconds

Donate


Go to top