madisona / django-google-maps

Using the Google Maps API with django model admin
BSD 2-Clause "Simplified" License
281 stars 99 forks source link

Add ability to show establishments in autocomplete #51

Closed fdobrovolny closed 4 years ago

madisona commented 5 years ago

I apologize for being so late in reviewing this. I'm looking at the documentation for autocomplete and wondering if it may be better to just remove the types argument altogether.

https://developers.google.com/maps/documentation/javascript/places-autocomplete

An array of types specifies an explicit type or a type collection, as listed in the supported types below. If nothing is specified, all types are returned. In general only a single type is allowed. The exception is that you can safely mix the geocode and establishment types, but note that this will have the same effect as specifying no types. The supported types are:

I don't know enough to know the use cases for when you may want results without including business results. Would it not make sense to always include them all by default?

fdobrovolny commented 5 years ago

No problem at all :) I was thinking and yes you are right that in most cases you would also want to be able to include businesses. On the other hand, I think that when you are entering something like home address it might not be desirable to include businesses. But I guess they should be included by default with possibility to turn them off? But maybe because it's admin panel people shouldn't add McDonald's as home address of someone.

madisona commented 5 years ago

Are there any other good patterns you've seen that make it easier to send data / options between Django and the javascript file? It would be nice to be able to have something in the settings.py file that could indicate whether you want the regular geocode only, establishments only, or both. And use regular geocode by default

madisona commented 4 years ago

closed in favor of https://github.com/madisona/django-google-maps/pull/58