Skip to content
Advertisement

Posting Coordinates to Database from Google Maps API

Edit: I solved the problem. Leaving it up in case someone needs something similar in the future.

I am trying to use google map api to get coordinates and save the information in a database. If the user drags the marker then a form is updated with the information. User can also enter the information manually in the form if she wants and the map will be updated with a new marker. Then the user can click submit and the information will be saved in the database.

Advertisement

Answer

I updated my first post with the code that is working for me.

I couldn’t update the map with the information from the form because I didn’t include the places library while loading the Maps JavaScript API.

I couldn’t see the updated coordinates after dragging the map marker because I didn’t enable the geocoding api and didn’t create a billing account with google cloud. I also restricted my API key.

Hope this helps.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement