Newbie one: How to insert the google map code into the form template


#1

Hello,

I’ve started using grav (with gantry5) and I’m trying to show a map in the contact form page.

I have a page folder “3.Contact” with the form file form.md in it as shown in the documentation: https://learn.getgrav.org/forms/forms/example-form

Then I’ve installed, enabled and configured the google map plugin and I was given this code to view the map:

[google-maps width='100%' lat=44.540 lng=-78.546 zoom=13 scrollwheel=true panControl=true iconurl='/absolute/path/to/marker/icon.png']
***My Place***
This is my place
[/google-maps]

If I put this on the form.md file, the maps shows but the form is not rendered. Where I must put the code?

Thanks in advance.


#2

hi @XaRz

Did you get your Google Api key ?


#3

Yes.
I finally used a gantry 5 particle to display It…but i want to do It with the grav plugin.


#4

I suggest you search the web for “grav google maps”. It will show you a couple of relevant Grav plugins and even some Grav Forum posts about that topic.


#5

Navigate to plugins/google-maps/google-maps.yaml and enter your Google Maps API and save the file.

Interesting though, you have to set up billing to use the Google Maps API. They they recommend restricting usage by creating a user for your API.

Not sure it’s worth all of that to embed a map :wink: