Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Just came across this when trying to use a custom icon url setting with a leaflet_views created view.
Uncaught Error: iconUrl not set in Icon options (see the docs).
In leaflet.drupal.js
Drupal.Leaflet.prototype.create_icon = function (options) {
var icon = new L.Icon({iconUrl: options.icon_url});
// rest of function code here
the
options.iconUrl
doesn't actually exist.
The parameter in the options object is actually named icon_url
Changing the parameter name fixes the issue, no JS error is thrown and the custom icon url is correctly applied.
Comment | File | Size | Author |
---|---|---|---|
#3 | leaflet-fix_incorrect_parameter_name_in_create_icon-2903134-3.patch | 408 bytes | focus13 |
Comments
Comment #2
focus13 CreditAttribution: focus13 as a volunteer and for Klee Interactive (Klee Group) commentedComment #3
focus13 CreditAttribution: focus13 as a volunteer and for Klee Interactive (Klee Group) commentedComment #4
focus13 CreditAttribution: focus13 as a volunteer and for Klee Interactive (Klee Group) commentedComment #5
focus13 CreditAttribution: focus13 as a volunteer and for Klee Interactive (Klee Group) commentedComment #6
geek-merlinDug through the source, this seems consolidated on iconUrl.