Kirby + Google Map

Hi, I’m trying to add Google maps on my project and have found this https://getkirby.com/docs/solutions/maps but can’t make it to work even with the simplest configuration stated on github.
Is this plugin still working?
Please can someone help me implement google map.
Thank you.

Hello :slight_smile:

You can try to install the Google Maps Tag Plugin, i hope this will Help you :slight_smile:

Oh, that one is still a Kirby 1 extension (which is now deprecated). Thanks for reporting, we will remove this from the docs.

You should be able to make this work with Kirby 2 by changing these two lines.

2 Likes

@lukasbestle
Thanks. Now its working after I changed the two lines. :joy:
BTW, why would you remove and not just update it with the new changes?

1 Like

The snippet itself is deprecated. Someone could create a Kirby 2 plugin out of it (by changing the two lines :smiley:), but it isn’t yet officially available for Kirby 2. Maybe we will officially publish it again, but I can’t promise that.

@lukasbestle Please update this solution officially for Kirby 2! - specially if all that is needed is a couple of lines of change…

The existing Google Map plugins are neither simple nor comprehensive. As ‘simplistic’ as your snippet solution may appear to you, it is actually very neat. It is a solution which will cover most common use-cases. Please, please, please keep it going, and put it back in the docs!

The issue with snippets like this one is that they are outdated very quickly. Google changes the API all the time and it has become so simple to embed a map on a webpage now.

We have decided that we can’t support and maintain plugins, so if anyone wants to, go ahead, take the old code and publish a modified and updated version of it. :slight_smile:

The Google Maps Javascript API is well documented with many examples, so you can easily add all sorts of individualized maps to your site.

There’s also a geolocation panel field and a Google Maps Kirbytag listed on http://getkirby-plugins.com

For an alternative implementation, check out Leaflet

1 Like

Thank you for the feedback, guys!

@texnixe I could never get the Google Maps Kirbytag plugin to work - have tried installing it three or four times, but it can never load the API. I must be doing something wrong during the installation, but I can’t workout what - it’s just an exercise in frustration… The geolocation panel field is cute, but quirky. I need to have 2 locations in the same template, and it cannot handle that. If I try to put the locations in a structure field, the layout gets screwed up… And even if I can get it to work, there is still the problem that this only works in the Panel: it doesn’t help me add a map to my template…

Thank you for the link to Leaflet - looks very interesting! Can it do geocoding? - I cannot seem to find it anywhere in their docs. It seems it requires you to input lat+lng, which means we still have to rely on Google or another service to convert the address into coordinates… Shame, because I’d love to get away from Google.

@lukasbestle Indeed, I had a look at the new Google Maps Embed API, and it’s stupidly simple to just plonk a map in an iframe. Unfortunately, we need to have a api “key”.

Once again, thank you both for your useful hints and guidance.

Hey! I have a nice little Maps field plugin that addresses some of the concerns you have about adding multiple maps per form.

1 Like

A quick research on Google revealed this geocoder for Leaflet.

And this solution on Stackoverflow might also be helpful to get started, so I’ll put it for future reference: http://stackoverflow.com/questions/30934341/leaflet-geosearch-get-lon-lat-from-address

IMO, it’s worth checking this out with OSM tiles as an alternative to using Google.