Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

Not working - JS Error #3

Open
nfacha opened this issue Jul 28, 2017 · 3 comments
Open

Not working - JS Error #3

nfacha opened this issue Jul 28, 2017 · 3 comments

Comments

@nfacha
Copy link

nfacha commented Jul 28, 2017

Uncaught TypeError: Cannot read property 'trim' of undefined
    at trim (Util.js:121)
    at splitWords (Util.js:127)
    at NewClass.on (Events.js:49)
    at NewClass.initialize (leaflet.markercluster-src.js:51)
    at new NewClass (Class.js:22)
    at Object.L.markerClusterGroup (leaflet.markercluster-src.js:1080)
    at map_init (map:678)
    at HTMLDocument.<anonymous> (map:683)
    at fire (jquery.js:3187)
    at Object.fireWith [as resolveWith] (jquery.js:3317)

Followed the documentation on readme, it looks like outdated tho

@nfacha nfacha changed the title Not working Not working - JS Error Jul 28, 2017
@kxxxo
Copy link

kxxxo commented Mar 30, 2018

Same error after install

@tonydspaniard
Copy link
Member

@nfacha @kxxxo Big apologies... I do not have much time to fix the bug my self right now, but I'll fix it as soon as i can.

@asilvestre87
Copy link

asilvestre87 commented May 23, 2018

Same error...
I need to change
$cluster = new MarkerCluster([
'jsonUrl' => Yii::$app->controller->createUrl('projects/json')
]);

for this:
$cluster = new MarkerCluster([
'url' => Yii::$app->urlManager->createUrl('projects/json')
]);

Because jsonUrl isn't throws this exception:
Setting unknown property: dosamigos\leaflet\plugins\markercluster\MarkerCluster::jsonUrl

and
Yii::$app->controller->createUrl('projects/json') throws: Calling unknown method: app\controllers\ProjectsController::createUrl()

but the error (Uncaught TypeError: Cannot read property 'trim' of undefined) don't fixed.

Finally, i added:
public $js = [
'https://unpkg.com/[email protected]/dist/leaflet.markercluster.js'
];
wich posted vladim1 in the other issue and works fine.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants