Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bindPopup trigger Cannot read property 'call' of undefined #5

Open
jeremy-saidani opened this issue Mar 23, 2021 · 1 comment
Open

Comments

@jeremy-saidani
Copy link

Hi,

I'am trying to add Popup to leaflet object in splitMap, but i'am getting this error :

TypeError: Cannot read property 'call' of undefined
NewClass.fire
src/core/Events.js:190
  187 | 			this._firingCount = (this._firingCount + 1) || 1;
  188 | 			for (var i = 0, len = listeners.length; i < len; i++) {
  189 | 				var l = listeners[i];
> 190 | 				l.fn.call(l.ctx || this, event);
      | ^  191 | 			}
  192 | 
  193 | 			this._firingCount--;

NewClass.removeLayer
src/layer/Layer.js:195
  192 | delete this._layers[id];
  193 | 
  194 | if (this._loaded) {
> 195 | 	this.fire('layerremove', {layer: layer});
      | ^  196 | 	layer.fire('remove');
  197 | }
  198 | 

NewClass.closePopup
src/layer/Popup.js:347
  344 | 		this._popup = null;
  345 | 	}
  346 | 	if (popup) {
> 347 | 		this.removeLayer(popup);
      | ^  348 | 	}
  349 | 	return this;
  350 | }

NewClass._close
src/layer/Popup.js:171
  168 | 
  169 | _close: function () {
  170 | 	if (this._map) {
> 171 | 		this._map.closePopup(this);
      | ^  172 | 	}
  173 | },
  174 | 

NewClass._onCloseButtonClick
src/layer/Popup.js:281
  278 | },
  279 | 
  280 | _onCloseButtonClick: function (e) {
> 281 | 	this._close();
      | ^  282 | 	DomEvent.stop(e);
  283 | },
  284 | 

HTMLAnchorElement.handler
src/dom/DomEvent.js:79
  76 | if (obj[eventsKey] && obj[eventsKey][id]) { return this; }
  77 | 
  78 | var handler = function (e) {
> 79 | 	return fn.call(context || obj, e || window.event);
     | ^  80 | };
  81 | 
  82 | var originalHandler = handler;
L.control.splitMap(leftPaneObjects, rightPaneObjects)

leftPaneObjects and rightPaneObjects are array of marker and polyline.
I used L.marker().bindPopup() : this crash
And L.popup() directly on map : this crash too
I tried to add popup on different pane, but still crash

If anyone has a solution, that would help me a lot, thanks !

@deven740
Copy link

deven740 commented Mar 5, 2022

hey I'm also facing this issue, did you find a solution to this?

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

No branches or pull requests

2 participants