Problem/Motivation
Uncaught TypeError: can't access property "indexOf", i is undefined
addTo Control.js:76
addControl Control.js:137
setPosition Control.js:52
initialise leaflet.drupal.js:278
Leaflet leaflet.drupal.js:225
loadMap leaflet.drupal.js:23
attach leaflet.drupal.js:193
attach leaflet.drupal.js:15
each jQuery
attach leaflet.drupal.js:10
attachBehaviors drupal.js:166
attachBehaviors drupal.js:162
htmx-behaviors.js:16
ae htmx.min.js:1
htmx-assets.js:148
promise callback* htmx-assets.js:139
ae htmx.min.js:1
n htmx.min.js:1
ie htmx.min.js:1
n htmx.min.js:1
e htmx.min.js:1
ze htmx.min.js:1
insert big_pipe.commands.js:79
insert big_pipe.commands.js:74
commandExecutionQueue big_pipe.commands.js:31
promise callback*Drupal.bigPipe.commandExecutionQueue/< big_pipe.commands.js:24
commandExecutionQueue big_pipe.commands.js:21
processReplacement big_pipe.js:69
checkMutationAndProcess big_pipe.js:94
processMutations big_pipe.js:118
processMutations big_pipe.js:117
MutationCallback* big_pipe.js:134
big_pipe.js:166
Control.js:76:33
Steps to reproduce
console error due to missing Map files.
Proposed resolution
change .library to use /libraries/leaflet... base
Remaining tasks
User interface changes
none
API changes
none
Data model changes
location of basic js plugin installed in /libraries/leaflet with the correct map files.
Issue fork leaflet-3588827
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3588827-js-map-files
changes, plain diff MR !70
Comments
Comment #2
skaughtComment #4
skaughtComment #5
itamair commentedNot clear at all the use case that is causing what you repot, and how to reproduce (you don't explain and don't even mention ... ).
The Leaflet Js library is correctly being loaded in the Drupal Leaflet module 10.4.x-dev (and previous releses).
More over the created MR !70 is pointing/looking to a Leaflet Js library that is assumed to be (magically?) present in the /library folder,
and thus finding it and breaking every (not rendering any) Leaflet map ...
It looks the issue being reported here is sourced by a very personal (and not typical) Drupal Leaflet module setup, totally not reproducible.
And the provide solution is totally arbitrary and not working ...
Indeed everything works as designed with the Leaflet Js loading in the Drupal Leaflet module ...
Comment #7
skaughtmy direct use-case is using code to draw a map into a block output:
Comment #8
itamair commentedThen of course you (still) need to load the leaflet-drupal library
https://git.drupalcode.org/project/leaflet/-/blob/10.4.x/leaflet.librari...
in your theme or that specific page anyway ...
ref: https://www.drupal.org/docs/develop/creating-modules/adding-assets-css-j...