Problem/Motivation

Leaflet Maps is so much than just rendering the map; its also about providing a nice set of interaction between user and map. Leaflet.js is certainly capable of that.
Drupal Leaflet.js has the beginnings of the js api. e.g.
$(document).trigger('leaflet.feature', [lFeature, feature]);
Let's have a js api capable of letting site-devs and other contrib modules be able to leverage leaflet to furnish those interactive widgets.

Who wants it? Can we have it?

Proposed resolution

  • Better documentation on api call $(document).trigger('leaflet.feature', [lFeature, feature]);
    For example on leaflet_demo an example.
  • More js api !

Remaining tasks

All of proposed resolution steps.

User interface changes

Interesting settings form changes might be in play like additional scripts multiselect option.
So on leaflet map render -- any additional scripts that are selected are triggered.

API changes

Discussion on how to go about it ..

Comments

chriscalip’s picture

Troublesome fact currently in drupal js api

Use JS events instead of Drupal.behaviors
https://www.drupal.org/node/1446166

Really have to ditch Drupal.behaviors in favor of modern jquery implementation.. at least with this module's implementation of js api.

Otherwise currently implementation leads other modules like leaflet_markercluster implementation of monkey patching.. not really feasible of an approach when it's potential use case calls for multiple additional scripts to be called in.. depending on context.

chriscalip’s picture

Status: Active » Closed (duplicate)

Duplicate of
"Refactor leaflet.drupal.js to allow other modules to extend and hook into map creation"
https://www.drupal.org/node/1893660