diff --git a/js/widget.js b/js/widget.js index cd7db6d..444c810 100644 --- a/js/widget.js +++ b/js/widget.js @@ -4,6 +4,9 @@ Drupal.behaviors.geofield_widget = { attach: function (context, settings) { + // Ensure we've set the default icon path to the leaflet library. + L.Icon.Default.imagePath = settings.leaflet_widget.defaultIconPath; + $('.leaflet-widget').once().each(function (i, item) { var id = $(item).attr('id'), options = settings.leaflet_widget_widget[id]; diff --git a/leaflet_widget.module b/leaflet_widget.module index e0fd1d6..717cf37 100644 --- a/leaflet_widget.module +++ b/leaflet_widget.module @@ -292,6 +292,12 @@ function leaflet_widget_library() { ), 'js' => array( "$leaflet/leaflet-src.js" => array(), + 0 => array( + 'type' => 'setting', + 'data' => array( + 'leaflet_widget' => array('defaultIconPath' => file_create_url($leaflet) . '/images'), + ), + ), ), );