Drupal 8 – How To Add Map Locations With Geolocation Field Module

Drupal tutorials webdesign videos
Lightning fast hosting for a shockingly low price! 50% off GoDaddy Hosting plans

Tutorial on how to store geographical locations and show them in a map.
“Django – The Easy Way” book is now available at https://leanpub.com/django-the-easy-way

Samuli Natri has been a software developer since the 90’s. He enjoys building web applications and games. He attended Helsinki University Of Technology (Computer Science) and Helsinki University (Social Sciences).






[su_feed url=”http://davidwalsh.name/feed” limit=”20″]

11 thoughts on “Drupal 8 – How To Add Map Locations With Geolocation Field Module”

  1. very helpful thanks – the Google API is now an extra heavy layer of configuration, and i also got appearent API referrer issues until i set up location defaults in the field widget – now all appears to be humming – than ks again!

  2. Hi. thanks for your tutorial. it helped a lot. But now I am trying to do something else. add filters from the nodes. But whatever i add, it doesn't show up on the page. Just the map.

    To understand what I am trying to replicate, this site shows it: https://www.cgi.com/en/offices

    the fields just below the map: Region,country,province,city. These are fields from the nodes. when i change the region selectbox, the other select drops change accordingly.

  3. Thank you for this tutorial…I am working on D8as per discussion below the patch suggested is for d7 … I could not use the patch…but I created the api key and pasted it in configuration geolocation…key with this the api key error is gonebut I am not able to display the map using geolocation yet… it says TypeError: map.settings.google_map_settings is undefined height is not defined…but I have defined height and width…I am not able to solve this map issue..I also used embed Iframes,iframe module,simple gmap no success… what is that I am missing..

  4. Google Map has changed now: "Google recently changed the terms of use of its Google Maps APIs; if you were already using them on a website (different from localhost) prior to June 22nd, 2016, nothing will change for you; otherwise, you will get the aforementioned issue and need an API key in order to fix your error. The free API key is valid up to 25,000 map loads per day."

    I have tried both drupal-7 and Drupal-8 (with your tutorial as base) and none is working. Now you need some kind of API-key that you save under Configuration/Geolocation. The problem is to find out what kind of API-key you need and if you need one for your local server for test and one for your Production Server.

    So if you can check this up and make two new tutorials (one for 7 and one for 8) including the request of API-keys from Google Map, that would be great!

    And yes, I like your tutorials, they are spot on, no winky-yanky talk!

Leave a Reply

Your email address will not be published. Required fields are marked *