Since we are about to upgrade from Openlayers 2.x to 3.x, and that upgrade involves completely rebuilding our map configuration, it's worth taking a moment to explore an alternative: Leaflet.js (http://drupal.org/project/leaflet).

Comments

m.stenta’s picture

Testing the Leaflet.js module now: https://www.drupal.org/project/leaflet

Will also need the Leaflet Widget module: https://www.drupal.org/project/leaflet_widget

m.stenta’s picture

Quickly set the area geofield field formatter and widget to use Leaflet and Leaflet Widget, respectively.

Initial impressions:

  • Polygon tool works nice.
  • Has a built-in feature delete button = mobile friendly
  • Line and point don't seem to work at all.
  • Geocoder doesn't seem to integrate the same way. There's no way to link it to the files field to allow KML uploads.
  • Leaflet maps, etc are not Ctools exportables (everything in Openlayers is)
m.stenta’s picture

See this related issue for a full list of everything we're doing with Openlayers currently.

m.stenta’s picture

Reasons NOT to switch to Leaflet.js:

  • Lots of things to code with Leaflet. And lots of new code conventions to learn. With Openlayers I will essentially be rebuilding most things in the UI, like I did originally.
  • Seems like there are some things that need to be debugged (ie: point and line drawing tools). This is par for the course for Openlayers... but perhaps "better the devil you know than the devil you don't" - I've gotten pretty familiar with Openlayers over the past year.
  • The Ctools exportable architecture of Openlayers lowers the barrier of experimentation for non-developers. Leaflet requires coding.
  • ...

Reasons TO switch to Leaflet.js:

  • More things in code! Hooray! More direct interaction with the process of building a map, so more control and possibilities, potentially.
  • Maybe easier to implement TMS layers? See #2492753: Support for TMS sources
  • ...
m.stenta’s picture

Leaflet widget cannot create complex geometries (yet).

m.stenta’s picture

Relevant issues in the Leaflet Widget issue queue:

#2335993: Geo-code from another field
#2392651: WMS layer support

This is also neat: https://www.drupal.org/project/leaflet_label

And this nifty graphic: #1807358: Drupal Mapping Diagrams

m.stenta’s picture

Status: Active » Closed (won't fix)

At this point I'm leaning towards sticking with Openlayers.

If I change my mind, I'll either reopen this ticket for further consideration or start some new ones.