Comments (2)
@ogix I discovered this same issue when I upgraded to 1.1.0 of Leaflet. As I do not need to support Leaflet 0.7.x, my solution was to comment out the following section at the top of the source file L.CanvasLayer.js:
L.DomUtil.setTransform = L.DomUtil.setTransform || function (el, offset, scale) {
var pos = offset || new L.Point(0, 0);
el.style[L.DomUtil.TRANSFORM] =
(L.Browser.ie3d ?
'translate(' + pos.x + 'px,' + pos.y + 'px)' :
'translate3d(' + pos.x + 'px,' + pos.y + 'px,0)') +
(scale ? ' scale(' + scale + ')' : '');
};
and then run "gulp scripts" to re-concatenate the JavaScript modules.
The developer included a _setTransform function in L.CanvasLayer.js that is a duplicate of the above section. As the only reference to setTransform occurs in the _animateZoom function in the same module, you might try adding the following exception catch:
_animateZoom: function _animateZoom(e) {
var scale = this._map.getZoomScale(e.zoom);
// -- different calc of offset in leaflet 1.0.0 and 0.0.7 thanks for 1.0.0-rc2 calc @jduggan1
var offset = L.Layer ? this._map._latLngToNewLayerPoint(this._map.getBounds().getNorthWest(), e.zoom, e.center) : this._map._getCenterOffset(e.center)._multiplyBy(-scale).subtract(this._map._getMapPanePos());
try {
L.DomUtil.setTransform(this._canvas, offset, scale);
}
catch (err) {
this._setTransform(this._canvas, offset. scale);
}
}
I have no way of testing this to see if it allows Leaflet 0.7.x to work, but my own fix above at least got this plugin working in my setup. Hope this helps.
from leaflet-velocity.
Also see this discussion on Leaflet's GitHub repo. It appears that they want plugins to use their own namespaces rather than altering the L namespace. This supports using the _setTransform function approach, I think.
from leaflet-velocity.
Related Issues (20)
- Get wind information at a point HOT 1
- can't get the right angle convention :) best is 90°
- Opacity option not used
- setOptions colorScale not woking? HOT 1
- How to prepare the data from openweather API for velocify wind map?
- Problem with Unicode characters in leaflet-velocity.js
- Query regarding demo wind.json file
- Cannot read properties of null (reading 'containerPointToLayerPoint')
- how can i find point Xindex, Yindex onMapClick ?
- Vector display/animations not showing HOT 5
- Project still working? HOT 2
- Processing data for leaflet-velocity HOT 1
- leaflet-velocity does not update from wind-js-server HOT 1
- Layer does not cover entire map HOT 2
- support CoverageJSON HOT 7
- is it possible to implement this plugin with tile server?
- parameterUnit - no info on valid values HOT 1
- Demo Broken in Chrome? HOT 2
- Implement rainfall data HOT 1
- Can we use this to also create isobars? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from leaflet-velocity.