quantstack / leaflet-splitmap Goto Github PK
View Code? Open in Web Editor NEWA Leaflet control to compare two map layers
License: MIT License
A Leaflet control to compare two map layers
License: MIT License
I'm getting this error here as I have explained in this stackoverflow-question
)
It looks like this line is the cause of jupyter-widgets/ipyleaflet#473:
Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.
The simplest thing I've seen for it would be:
includes: L.version[0]==='1' ? L.Evented.prototype : L.Mixin.Events,
Dragging of split slider is not possible (anymore) due to an incorrect assumption of the L.Browser module.
on(range, L.Browser.touch ? 'touchstart' : 'mousedown', cancelMapDrag, this)
on(range, L.Browser.touch ? 'touchend' : 'mouseup', uncancelMapDrag, this)
Tested with Google Chrome 105.0.5195.102 and version earlier.
Android/iOS is still working, only desktop browsers are affected.
Background;:
L.Browser.touch stays true even if you are using a non-touch device. It would be better to rely on global window variable like other leaflet plugins.
I like this control a lot, but some time it's needed it to work on vertical screens (in my case in vertical signaling screen, but could also mean in portrait mobile devices).
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 !
The sample code just doesn't work.
I've also tried to import this in my vue project and bypassing the missing type definitions it doesn't add sideBySide to L.control
I tried the original leaflet-side-by-side and everything imports fine (just getting 1 layer, no comparison)
arg==='undefined'
=>arg===undefined
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.