Drupal 10: Creating interactive map using Leaflet


I'm hoping to get a map page added to the blog that would allow me to provide a user experience that displays a number of locations, and clicking on that location would navigate to the blog post about that.  Most sites seem to recommend the 'Leaflet module" which seemed to do exactly that.   Sounds relatively easy!  Install the module, and off we go!

However, it has proven a lot more confusing that I thought it would be; here's what I learned.  Again, I'm using Drupal version 10.


Install the module onto your Drupal server (SSH into the server, and run <>)

Add the module using the 'extend' feature.   

To create the interactive map, we need the following:

  1. A new content type to store each of our locations or landmarks, based on the type provided by the Leaflet module
  2. A new view that shows all of the locations on the Leaflet map, using the Leaflet Views module. 

Some homework is needed to collect the latitude and longitude for each of the locations (Open Street Map or Google Map can provide this).









Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.