Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autocomplete widget with map #174

Open
4 of 5 tasks
vladimirmyshkovski opened this issue Jul 19, 2017 · 3 comments
Open
4 of 5 tasks

Autocomplete widget with map #174

vladimirmyshkovski opened this issue Jul 19, 2017 · 3 comments

Comments

@vladimirmyshkovski
Copy link

vladimirmyshkovski commented Jul 19, 2017

Checklist

  • I have verified that I am using a GIS-enabled database, such as PostGIS or Spatialite.
  • I have verified that that issue exists against the master branch of django-cities.
  • I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
  • I have reduced the issue to the simplest possible case.
  • I have included a failing test as a pull request. (If you are unable to do so we can still accept the issue.)

Steps to reproduce

Expected behavior

Hey.

I want to provide an opportunity for users to have a widget like this so that they can enter the address and see their point on the map.

One option is to parse the answer from Google or another provider, and search for objects in the database.

Another option is to get the longitude and latitude from the widget, and for longitude and latitude, look for the nearest country / city / district.

In any case, I want to use your application, and in addition I need a custom widget.

How can i do this ?

If you direct me to the right idea, I'm ready to push, or I'll make a small extension that will stacked with yours.

Actual behavior

@blag
Copy link
Collaborator

blag commented Jul 20, 2017

Check out another project I maintain, django-osm-field. It should do what you want.

When you submit the form you should be able to access json.loads(form.cleaned_data['location_data']) and setup the Country/Region/Subregion/City accordingly.

But I would definitely appreciate a PR implementing a custom form field/widget that does that.

@vladimirmyshkovski
Copy link
Author

@blag , I can not get the region and subregion from the data received from the providers.

If it were not for these two components, it would be more or less simple.

@blag
Copy link
Collaborator

blag commented Dec 3, 2017

@narnikgamarnikus You'll have to add some details to your last comment. Are you having an issue importing the region and subregion data? If so, please open a separate issue for those. If it's something else, please explain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants