mapbox-gl-leaflet
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -117,5 +117,13 @@ L.MapboxGL = L.Layer.extend({ | ||
if (this._glMap._canvas.canvas) { | ||
// older versions of mapbox-gl surfaced the canvas differently | ||
this._glMap._actualCanvas = this._glMap._canvas.canvas; | ||
} else { | ||
this._glMap._actualCanvas = this._glMap._canvas; | ||
} | ||
// treat child <canvas> element like L.ImageOverlay | ||
L.DomUtil.addClass(this._glMap._canvas, 'leaflet-image-layer'); | ||
L.DomUtil.addClass(this._glMap._canvas, 'leaflet-zoom-animated'); | ||
L.DomUtil.addClass(this._glMap._actualCanvas, 'leaflet-image-layer'); | ||
L.DomUtil.addClass(this._glMap._actualCanvas, 'leaflet-zoom-animated'); | ||
}, | ||
@@ -151,8 +159,13 @@ | ||
if (gl._resize !== null && gl._resize !== undefined){ | ||
gl._resize(); | ||
gl._resize(); | ||
} else { | ||
gl.resize(); | ||
gl.resize(); | ||
} | ||
} else { | ||
gl._update(); | ||
// older versions of mapbox-gl surfaced update publicly | ||
if (gl._update !== null && gl._update !== undefined){ | ||
gl._update(); | ||
} else { | ||
gl.update(); | ||
} | ||
} | ||
@@ -174,3 +187,3 @@ }, | ||
L.DomUtil.setTransform(this._glMap._canvas, offset.subtract(this._offset), scale); | ||
L.DomUtil.setTransform(this._glMap._actualCanvas, offset.subtract(this._offset), scale); | ||
}, | ||
@@ -186,3 +199,3 @@ | ||
L.DomUtil.setTransform(this._glMap._canvas, offset.subtract(this._offset), scale); | ||
L.DomUtil.setTransform(this._glMap._actualCanvas, offset.subtract(this._offset), scale); | ||
@@ -199,3 +212,3 @@ this._zooming = false; | ||
// reset the scale and offset | ||
L.DomUtil.setTransform(this._glMap._canvas, offset, 1); | ||
L.DomUtil.setTransform(this._glMap._actualCanvas, offset, 1); | ||
@@ -202,0 +215,0 @@ // enable panning once the gl map is ready again |
{ | ||
"name": "mapbox-gl-leaflet", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "binding from mapbox gl to the leaflet api", | ||
@@ -30,4 +30,5 @@ "main": "leaflet-mapbox-gl.js", | ||
"devDependencies": { | ||
"gh-release": "^2.2.1", | ||
"jshint": "~2.5.5" | ||
} | ||
} |
@@ -62,3 +62,2 @@ **Note: this tool is experimental and is not actively supported by Mapbox. For support, please open an issue in this repository.** | ||
- No rotation / bearing / pitch support | ||
- No fractionnal zoom (hability to zoom between zoom levels) | ||
- Slower performances: When using mapbox-gl-leaflet, mapbox-gl-js is set as not interactive. Leaflet receives the touch/mouse events and updates the mapbox-gl-js map behind the scenes. Because mapbox-gl-js doesn't redraw as fast as Leaflet, the map can seem slower. | ||
@@ -65,0 +64,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
18119
10
181
0
2
77