New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mapbox-gl-leaflet

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mapbox-gl-leaflet - npm Package Compare versions

Comparing version 0.0.9 to 0.0.10

5

CHANGELOG.md

@@ -9,2 +9,7 @@ # Change Log

## [0.0.10] - 2019-09-16
- added `.getContainer()`, `.getSize()`, `getBounds()` and `getCanvas()` methods.
- internal code changes to bring it closer to other overlay layers.
## [0.0.9] - 2019-09-02

@@ -11,0 +16,0 @@

37

leaflet-mapbox-gl.js

@@ -38,7 +38,7 @@ (function (root, factory) {

onAdd: function (map) {
if (!this._glContainer) {
if (!this._container) {
this._initContainer();
}
this.getPane().appendChild(this._glContainer);
this.getPane().appendChild(this._container);

@@ -60,3 +60,3 @@ this._initGL();

this.getPane().removeChild(this._glContainer);
this.getPane().removeChild(this._container);
this._glMap.remove();

@@ -80,10 +80,27 @@ this._glMap = null;

_getSize: function () {
getCanvas: function () {
return this._glMap.getCanvas();
},
getSize: function () {
return this._map.getSize().multiplyBy(1 + this.options.padding * 2);
},
getBounds: function () {
var halfSize = this.getSize().multiplyBy(0.5);
var center = this._map.latLngToContainerPoint(this._map.getCenter());
return L.latLngBounds(
this._map.containerPointToLatLng(center.subtract(halfSize)),
this._map.containerPointToLatLng(center.add(halfSize))
);
},
getContainer: function () {
return this._container;
},
_initContainer: function () {
var container = this._glContainer = L.DomUtil.create('div', 'leaflet-gl-layer');
var container = this._container = L.DomUtil.create('div', 'leaflet-gl-layer');
var size = this._getSize();
var size = this.getSize();
var offset = this._map.getSize().multiplyBy(this.options.padding);

@@ -102,3 +119,3 @@ container.style.width = size.x + 'px';

var options = L.extend({}, this.options, {
container: this._glContainer,
container: this._container,
center: [center.lng, center.lat],

@@ -141,4 +158,4 @@ zoom: this._map.getZoom() - 1,

var size = this._getSize(),
container = this._glContainer,
var size = this.getSize(),
container = this._container,
gl = this._glMap,

@@ -190,3 +207,3 @@ offset = this._map.getSize().multiplyBy(this.options.padding),

var padding = this._map.getSize().multiplyBy(this.options.padding * scale);
var viewHalf = this._getSize()._divideBy(2);
var viewHalf = this.getSize()._divideBy(2);
// corrections for padding (scaled), adapted from

@@ -193,0 +210,0 @@ // https://github.com/Leaflet/Leaflet/blob/master/src/map/Map.js#L1490-L1508

{
"name": "mapbox-gl-leaflet",
"version": "0.0.9",
"version": "0.0.10",
"description": "binding from mapbox gl to the leaflet api",

@@ -5,0 +5,0 @@ "main": "leaflet-mapbox-gl.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc