formtools / core

The Form Tools Core.
https://formtools.org
207 stars 78 forks source link

Google Maps API - JS ERROR(solved) - Add Location Botton #632

Closed nelsondcosta23 closed 4 years ago

nelsondcosta23 commented 4 years ago

Hi guys, how are you? Do you have any extra tips for google maps api to work?

I use the API and get the error on the form image

API - key module image

nelsondcosta23 commented 4 years ago

Solved, problem with API Any one knows how add "location" botton? I mean press a botton to locate where I am?

Something like image Do think this might help? https://stackoverflow.com/questions/24952593/how-to-add-my-location-button-in-google-maps

benkeen commented 4 years ago

Hey @nelsondcosta23, that should actually be pretty straightforward. Let me take a look at it.

nelsondcosta23 commented 4 years ago

Hi @benkeen , how are you? I was looking inside the code of module.class and custom field until now I had done some stuffs. But the location botton until now I have no ideia. By the way for the people who might need this, if you want extra option like

image

Just go module -> Custom Field -> Google Maps -> JS -> and: zoom: 17, (ZOON) center: new google.maps.LatLng(41.1579438, -8.629105299999992), (LOCATION OF START) mapTypeId: google.maps.MapTypeId.ROADMAP, streetViewControl: true, mapTypeControl: true,

benkeen commented 4 years ago

Hey @nelsondcosta23, I've got it working locally and I'll add it to the next version of the google maps module. However, the web API to get the user's lat/lng coordinates only runs consistently on browsers using https, not http, so I'll only add the button for secure websites. Screenshot attached.

Screen Shot 2019-10-16 at 10 07 57 PM
benkeen commented 4 years ago

Closing. I created an issue on the Google Maps module above.

benkeen commented 4 years ago

I just released 2.1.0 of the Google maps module - I'll update the docs tonight.

benkeen commented 4 years ago

2.1.1 is updated to properly update the DB. And yeah - it'll overwrite any custom changes you made, Nelson, so be warned!