Is it possible to use existing Backdrop CMS modules to add multiple points to a map. 

In Drupal 7 I would use the geofield module and the geofield map sub module to create a view of addresses on a map. I'm trying to figure out the best way to accomplish this today with Backdrop CMS or if it is possible without any custom code?

Any ideas?

Editing question to show some of what I've found:

Ports of these modules have been started, but not yet completed:

https://github.com/backdrop-contrib/geofield
https://github.com/backdrop-contrib/geocoder
https://github.com/backdrop-contrib/geophp

This module is stable and I'm using it on another project to display a map with a single address, which does not solve my existing problem:

https://backdropcms.org/project/simple_gmap

I'm not sure if the Geolocation module will help me with views?

https://backdropcms.org/project/geolocation

UPDATE (August 25, 2019):

Geocoder now (since Dec 2018) has official release: https://backdropcms.org/project/geocoder

Comments

My team may be willing to help finish the partial ports of existing modules or try porting another option such as https://www.drupal.org/project/gmap - but, this feels like a project we'd need help with. Anyone interested?

I got some feedback on the status of the geofield/geocoder/geophp modules. Apparently, in conjunction with some existing pull requests they are functional (it would be great to get these released on BackdropCMS.org). I've got them partially working, I'm just having problems getting the geocode field automatically populated using the addressfield. This may be a configuration problem on my part. I continue to experiment with it. But, it's working if I add the lat/lon manually.

My final issue was getting the geocoder to work with Google API. I kept getting this error "Exception: Google API returned bad status.\nStatus: REQUEST_DENIED in geocoder_google() (line 124 " 

https://github.com/backdrop-contrib/geocoder/issues/9

I finally gave up with Google and used the Bing API (something I thought I would never say) successfully. I will try to write a blog post or create a screencast on how to do this. 

mazze's picture

Hi Tim, did you implement it successfully yet...? My customer wants some addresses placed on one map, so I created  a View

https://landwirtschaft.ag/geomap (test page)

This is table mode (hence one map per address), but when I change the display from "table" to "geofield map", it stops working.

mazze's picture

[answer taken from the Zulip Channel, thank you @indgoxela]

*****

It's possible, but no fun - the necessary modules aren't stable yet:

Install:

  • geofield
  • leaflet (no stable release)
  • libraries (not needed, but a useless dependency)
  • geophp (no dependency, but actually required to prevent fatal errors)

Then:

  • Create a content type with a geofield that stores lat/lon
  • Enable leaflet_views submodule
  • Create a view of type "leaflet map"
  • Filtered for your content type, don't forget to add a geofield to the view

Works, but... :wink: the Leaflet module really needs some loving care.

jenlampton's picture

I've got an example of multiple addresses on a single map here: http://arf.berkeley.edu/

I used the geofield module to produce the map. 

Views UI for how to set up the map

These modules are stable (I am using both of them on the ARF site, above):

https://github.com/backdrop-contrib/geofield
https://github.com/backdrop-contrib/geocoder

This module is not necessary for Backdrop (anymore), as it contains only a library, and the library is bundled in Geocoder now:

https://github.com/backdrop-contrib/geophp

I'm working on a blog post with more details and screenshots. 

https://simplo.site/posts/putting-multiple-locations-map-backdrop-cms

(I would appreciate any feedback on the blog post).

The real hassle in all this dealing with the GoogleAPI key. 

https://www.riverton.org/community/map-of-all-communities

 

This module is not necessary for Backdrop (anymore), as it contains only a library, and the library is bundled in Geocoder now:

https://github.com/backdrop-contrib/geophp

This is only true if you use the DEV version of GeoCoder (although I would not be surprised to see a new release of GeoCoder very soon that fixes this problem - any version of Geocoder later than 1.x-1.0.0 should work without GeoPHP).