esri-leaflet-vector
Advanced tools
Comparing version 1.0.7 to 2.0.0
@@ -8,2 +8,25 @@ # Change Log | ||
## [2.0.0] | ||
### Changed | ||
* Existing basemaps have been updated to [`v2`](https://www.esri.com/arcgis-blog/products/arcgis-living-atlas/mapping/whats-new-in-esri-vector-basemaps-december-2017/) | ||
### Added | ||
* Esri's [OpenStreetMap Vector basemap](https://www.esri.com/arcgis-blog/products/arcgis-living-atlas/mapping/new-osm-vector-basemap/) | ||
### Breaking Change | ||
* `mapbox-gl-js` is now an external dependency. it is no longer bundled internally. | ||
```html | ||
<link rel="stylesheet" href="https://unpkg.com/mapbox-gl/dist/mapbox-gl.css"/> | ||
<script src="https://unpkg.com/mapbox-gl/dist/mapbox-gl.js"></script> | ||
<!-- Esri Leaflet --> | ||
<script src="https://unpkg.com/esri-leaflet/dist/esri-leaflet.js"></script> | ||
<script src="https://unpkg.com/esri-leaflet-vector/dist/esri-leaflet-vector.js"></script> | ||
``` | ||
## [1.0.7] | ||
@@ -70,3 +93,4 @@ | ||
[unreleased]: https://github.com/esri/esri-leaflet-vector/compare/v1.0.7...HEAD | ||
[unreleased]: https://github.com/esri/esri-leaflet-vector/compare/v2.0.0...HEAD | ||
[2.0.0]: https://github.com/esri/esri-leaflet-vector/compare/v1.0.7...v2.0.0 | ||
[1.0.7]: https://github.com/esri/esri-leaflet-vector/compare/v1.0.6...v1.0.7 | ||
@@ -73,0 +97,0 @@ [1.0.6]: https://github.com/esri/esri-leaflet-vector/compare/v1.0.5...v1.0.6 |
{ | ||
"name" : "esri-leaflet-vector", | ||
"name": "esri-leaflet-vector", | ||
"description": "Esri vector basemap plugin for Leaflet.", | ||
"version": "1.0.7", | ||
"version": "2.0.0", | ||
"author": "John Gravois <jgravois@esri.com> (http://johngravois.com)", | ||
@@ -13,6 +13,6 @@ "contributors": [ | ||
"dependencies": { | ||
"esri-leaflet": "^2.0.3", | ||
"esri-leaflet": "^2.1.2", | ||
"leaflet": "^1.0.0", | ||
"mapbox-gl": "git+https://github.com/Esri/mapbox-gl-js.git#indexed-vector-sources", | ||
"mapbox-gl-leaflet": "git+https://github.com/mapbox/mapbox-gl-leaflet#v0.0.3" | ||
"mapbox-gl-leaflet": "0.0.3" | ||
}, | ||
@@ -24,7 +24,7 @@ "devDependencies": { | ||
"nodemon": "^1.9.2", | ||
"rollup": "^0.25.4", | ||
"rollup-plugin-commonjs": "^7.0.0", | ||
"rollup-plugin-json": "^2.0.0", | ||
"rollup-plugin-node-resolve": "^1.4.0", | ||
"rollup-plugin-uglify": "^0.3.1", | ||
"rollup": "^0.57.1", | ||
"rollup-plugin-commonjs": "^9.1.0", | ||
"rollup-plugin-json": "^2.3.0", | ||
"rollup-plugin-node-resolve": "^3.3.0", | ||
"rollup-plugin-uglify": "^3.0.0", | ||
"semistandard": "^7.0.5", | ||
@@ -34,2 +34,7 @@ "snazzy": "^2.0.1", | ||
}, | ||
"files": [ | ||
"src/**/*.js", | ||
"dist/*.js", | ||
"dist/*.js.map" | ||
], | ||
"homepage": "https://github.com/Esri/esri-leaflet-vector#readme", | ||
@@ -36,0 +41,0 @@ "jsnext:main": "src/EsriLeafletVector.js", |
@@ -11,2 +11,11 @@ # Esri Leaflet Vector Tile Plugin | ||
## Disclaimer | ||
The code here is a house of cards that attempts to synchronize a [WebGLRenderingContext](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext) with a Leaflet map. | ||
* It doesn't support rotation | ||
* It can't draw more than one vector tile source at a time. | ||
For production applications, the [ArcGIS API for JavaScript](https://developers.arcgis.com/javascript/latest/sample-code/layers-vectortilelayer/index.html) is a **much** more appropriate choice. | ||
## Example | ||
@@ -25,9 +34,13 @@ | ||
<!-- Load libraries from CDN --> | ||
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.0.1/dist/leaflet.css" /> | ||
<script src="https://unpkg.com/leaflet@1.0.1"></script> | ||
<!-- Load Leaflet from CDN --> | ||
<link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css"/> | ||
<script src="https://unpkg.com/leaflet/dist/leaflet.js"></script> | ||
<!-- Load Mapbox GL --> | ||
<link rel="stylesheet" href="https://unpkg.com/mapbox-gl/dist/mapbox-gl.css"/> | ||
<script src="https://unpkg.com/mapbox-gl/dist/mapbox-gl.js"></script> | ||
<!-- Esri Leaflet and Esri Leaflet Vector --> | ||
<script src="https://unpkg.com/esri-leaflet@2.0.3"></script> | ||
<script src="https://unpkg.com/esri-leaflet-vector@1.0.3"></script> | ||
<script src="https://unpkg.com/esri-leaflet/dist/esri-leaflet.js"></script> | ||
<script src="https://unpkg.com/esri-leaflet-vector/dist/esri-leaflet-vector.js"></script> | ||
@@ -73,3 +86,3 @@ <style> | ||
* [Mapbox GL Leaflet](https://github.com/jgravois/mapbox-gl-leaflet.git#indexed-vector-sources) | ||
* [a fork of Mapbox GL JS](https://github.com/Esri/mapbox-gl-js.git#indexed-vector-sources) | ||
* [mapbox-gl-js](https://www.mapbox.com/mapbox-gl-js/) | ||
@@ -85,7 +98,7 @@ ## Resources | ||
Find a bug or want to request a new feature? Please let us know by submitting an [issue](https://github.com/Esri/esri-leaflet-heatmap-feature-layer/issues). | ||
Find a bug or want to request a new feature? Please let us know by submitting an [issue](https://github.com/Esri/esri-leaflet-vector/issues). | ||
Please take a look at previous issues on [Esri Leaflet](https://github.com/Esri/esri-leaflet/issues?labels=FAQ&milestone=&page=1&state=closed) and Esri Leaflet [Vector](https://github.com/Esri/esri-leaflet-vector/issues) that resolve common problems. | ||
Please take a look at previous issues on [Esri Leaflet](https://github.com/Esri/esri-leaflet-vector/issues?labels=FAQ&milestone=&page=1&state=closed) and Esri Leaflet [Vector](https://github.com/Esri/esri-leaflet-vector/issues) that resolve common problems. | ||
You can also post issues on the [GIS Stackexchange](http://gis.stackexchange.com/questions/ask?tags=esri-leaflet,leaflet) an/or the [Esri Leaflet place](https://geonet.esri.com/discussion/create.jspa?sr=pmenu&containerID=1841&containerType=700&tags=esri-leaflet,leaflet) on GeoNet. | ||
You can also post issues on the [GIS Stack Exchange](http://gis.stackexchange.com/questions/ask?tags=esri-leaflet,leaflet) an/or the [Esri Leaflet place](https://geonet.esri.com/discussion/create.jspa?sr=pmenu&containerID=1841&containerType=700&tags=esri-leaflet,leaflet) on GeoNet. | ||
@@ -99,4 +112,5 @@ ## Contributing | ||
## Licensing | ||
Copyright 2016 Esri | ||
Copyright © 2016-2018 Esri | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
@@ -115,4 +129,1 @@ you may not use this file except in compliance with the License. | ||
A copy of the license is available in the repository's [LICENSE](./LICENSE) file. | ||
[](Esri Tags: ArcGIS Web Mapping Leaflet Vector VectorTiles Tiles) | ||
[](Esri Language: JavaScript) |
@@ -10,15 +10,21 @@ import L from 'leaflet'; | ||
STYLES: { | ||
'DarkGray': '57436c01bc754dbb87dfb636b6484022', | ||
'Gray': '1e47168d181248e491541ffd5a91c0de', | ||
'Hybrid': 'af6063d6906c4eb589dfe03819610660', | ||
'Navigation': 'e19e9330bf08490ca8353d76b5e2e658', | ||
'Streets': 'a60a37a27cc140ddad15f919cd5a69f2', | ||
'StreetsNight': '92c551c9f07b4147846aae273e822714', | ||
'StreetsRelief': '78c0a9ab4fbf4198a8b951848aab19d8', | ||
'Topographic': '86d5ed4b6dc741de9dad5f0fbe09ae95', | ||
'Spring': '763884983d3544c0a418a97992881fce', | ||
'Newspaper': '4f4843d99c34436f82920932317893ae', | ||
'MidCentury': '267f44f08a844c7abee2b62b00600540', | ||
'ModernAntique': '996d9e7a3aac4514bb692ce7a990f1c1', | ||
'BlackAndWhite': '3161443179244702a5e0449010013b54' | ||
'OpenStreetMap': '3e1a00aeae81496587988075fe529f71', | ||
// v2 | ||
'Streets': 'de26a3cf4cc9451298ea173c4b324736', | ||
'StreetsRelief': 'b266e6d17fc345b498345613930fbd76', | ||
// 7dc6cea0b1764a1f9af2e679f642f0f5 doesnt pass validation | ||
'Topographic': '7a6bf0e8cb5a418085e66c0485e74d19', | ||
// 86f556a2d1fd468181855a35e344567f doesnt pass validation | ||
'StreetsNight': '93554006894c45a88136127535878fca', | ||
'Newspaper': 'dfb04de5f3144a80bc3f9f336228d24a', | ||
'Navigation': '63c47b7177f946b49902c24129b87252', | ||
'Nova': '75f4dfdff19e445395653121a95a85db', | ||
'ColoredPencil': '4cf7e1fb9f254dcda9c8fbadb15cf0f8', | ||
'Hybrid': '30d6b8271e1849cd9c3042060001f425', | ||
'Gray': '291da5eab3a0412593b66d384379f89f', // no labels | ||
'DarkGray': '5e9b3685f4c24d8781073dd928ebda50', // no labels | ||
'HumanGeography': '2afe5b807fa74006be6363fd243ffb30', // no labels | ||
'HumanGeographyDetail': '97fa1365da1e43eabb90d0364326bc2d', // no labels | ||
'DarkHumanGeography': 'd7397603e9274052808839b70812be50' // no labels | ||
// 'ModernAntique': 'effe3475f05a4d608e66fd6eeb2113c0', // throws mismatched image size error | ||
} | ||
@@ -33,2 +39,4 @@ }, | ||
this._basemap = options.key; | ||
if (typeof options.key === 'string' && Basemap.STYLES[options.key]) { | ||
@@ -44,9 +52,12 @@ var url = Basemap.URLPREFIX + Basemap.STYLES[options.key] + Basemap.URLSUFFIX; | ||
this._map = map; | ||
Util.setEsriAttribution(map); | ||
if (map.attributionControl) { | ||
// 95% sure this is the right static attribution url | ||
Util._getAttributionData('https://static.arcgis.com/attribution/World_Street_Map', map); | ||
map.attributionControl.addAttribution('<span class="esri-dynamic-attribution">USGS, NOAA</span>'); | ||
if (this._basemap === 'OpenStreetMap') { | ||
map.attributionControl.setPrefix('<a href="http://leafletjs.com" title="A JS library for interactive maps">Leaflet</a>'); | ||
map.attributionControl.addAttribution('<span class="esri-dynamic-attribution">© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, map layer by Esri</span>'); | ||
} else { | ||
Util._getAttributionData('https://static.arcgis.com/attribution/World_Street_Map', map); | ||
map.attributionControl.addAttribution('<span class="esri-dynamic-attribution">USGS, NOAA</span>'); | ||
} | ||
} | ||
@@ -76,8 +87,11 @@ | ||
var map = this._map; | ||
// thought it was just me, but apparently its not easy to mixin two different styles | ||
// https://github.com/mapbox/mapbox-gl-js/issues/4000 | ||
// set the background color of the map to the background color of the tiles | ||
map.getContainer().style.background = this._mapboxGL.options.style.layers[0].paint['background-color']; | ||
map.getContainer().style.background = this._mapboxGL.options.style.layers[0].paint['background-color'] || '#e1e3d0'; | ||
map.on('moveend', Util._updateMapAttribution); | ||
this._mapboxGL.addTo(map, this); | ||
// map._gl = this._mapboxGL; | ||
} | ||
@@ -84,0 +98,0 @@ }); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Git dependency
Supply chain riskContains a dependency which resolves to a remote git URL. Dependencies fetched from git URLs are not immutable and can be used to inject untrusted code or reduce the likelihood of a reproducible install.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
124
1
0
1
120153
12
712
+ Addedmapbox-gl-leaflet@0.0.3(transitive)
Updatedesri-leaflet@^2.1.2
Updatedmapbox-gl-leaflet@0.0.3