1

I am new to GIS and have been working on a webapp for location sharing. I want to be able to have my users be able to "Pin" their location in a map. For this I installed Geodjango/PostgreSQL/Postgis did the Geodjango tutorial and have a fully working map.

My problem is that I am not sure what the next step should be to be able to get the request the user's information (their location) when they decide to "pin" the location and be able to accurately put it on the map.

I am using django 1.11

0

You will need to build two parts to record user locations:

  • A front end solution, probably including a javascript based map (for example, by using leaflet or google maps) and the HTML5 geolocation API (Example here). Eventually this will create an HTTP/XHR call to your server (use HTTP POST) with your user's location details.
  • A Django view that accepts this call and records the location and the user information. You would probably want to save this info in a Django model with a PointField field.

Good luck!

  • so just to clarify the map that geodjango provides can't do these capabilities or its just better to use google maps? – Migdotcom Jan 30 '18 at 12:55
  • Django is a backend framework and includes some very minimal frontend code that uses openlayers. There are Django packages for integrating leaflet and Google maps which are more advanced than openlayers. – Udi Jan 30 '18 at 16:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.