Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VectorTileLayer #70

Merged
merged 4 commits into from
Sep 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />

<!-- Load Leaflet from CDN-->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/leaflet/1.0.0-rc.1/leaflet.css" />
<script src="https://cdn.jsdelivr.net/leaflet/1.0.0-rc.1/leaflet-src.js"></script>

<!-- Load Leaflet Label from GitHub -->
<script src="https://leaflet.github.io/Leaflet.label/leaflet.label.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/leaflet/1.0.0-rc.3/leaflet.css" />
<script src="https://cdn.jsdelivr.net/leaflet/1.0.0-rc.3/leaflet-src.js"></script>

<!-- Load Esri Leaflet from CDN -->
<script src="https://cdn.jsdelivr.net/leaflet.esri/2.0.0/esri-leaflet.js"></script>
<script src="https://cdn.jsdelivr.net/leaflet.esri/2.0.3/esri-leaflet.js"></script>

<!-- Load Leaflet Heat from CDN -->
<script src="https://rawgit.com/Leaflet/Leaflet.heat/gh-pages/dist/leaflet-heat.js"></script>

<!-- Load Heatmap Feature Layer from CDN -->
<script src="https://cdn.jsdelivr.net/leaflet.esri.heatmap-feature-layer/2.0.0-beta.1/esri-leaflet-heatmap-feature-layer.js"></script>

<!-- Load Esri Leaflet Vector Tile from CDN -->
<script src="//unpkg.com/[email protected]"></script>

<!-- Load Esri Leaflet Renderers from CDN -->
<script src="//cdn.jsdelivr.net/leaflet.esri.renderers/2.0.3/esri-leaflet-renderers.js"></script>

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"esri-leaflet": "^2.0.0",
"esri-leaflet-heatmap-feature-layer": "^2.0.0-beta.1",
"esri-leaflet-renderers": "^2.0.4",
"esri-leaflet-vector": "^1.0.2",
"leaflet": "^1.0.0-rc.1",
"leaflet-omnivore": "^0.3.2",
"leaflet-vectoricon": "^0.1.0",
Expand Down
36 changes: 36 additions & 0 deletions src/OperationalLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,42 @@ export function _generateEsriLayer (layer, layers, map, params, paneName) {

layers.push({ type: 'TML', title: layer.title || '', layer: lyr });

return lyr;
} else if (layer.layerType === 'VectorTileLayer') {
var keys = {
'World Street Map (with Relief)': 'StreetsRelief',
'World Street Map (with Relief) (Mature Support)': 'StreetsRelief',
'Hybrid Reference Layer': 'Hybrid',
'Hybrid Reference Layer (Mature Support)': 'Hybrid',
'World Street Map': 'Streets',
'World Street Map (Mature Support)': 'Streets',
'World Street Map (Night)': 'StreetsNight',
'World Street Map (Night) (Mature Support)': 'StreetsNight',
'Dark Gray Canvas': 'DarkGray',
'Dark Gray Canvas (Mature Support)': 'DarkGray',
'World Topographic Map': 'Topographic',
'World Topographic Map (Mature Support)': 'Topographic',
'World Navigation Map': 'Navigation',
'World Navigation Map (Mature Support)': 'Navigation',
'Light Gray Canvas': 'Gray',
'Light Gray Canvas (Mature Support)': 'Gray'
//'Terrain with Labels': '',
//'World Terrain with Labels': '',
//'Light Gray Canvas Reference': '',
//'Dark Gray Canvas Reference': '',
//'Dark Gray Canvas Base': '',
//'Light Gray Canvas Base': ''
};

if (keys[layer.title]) {
lyr = L.esri.Vector.basemap(keys[layer.title]);
} else {
console.error('Unsupported Vector Tile Layer: ', layer);
lyr = L.featureGroup([]);
}

layers.push({ type: 'VTL', title: layer.title || layer.id || '', layer: lyr });

return lyr;
} else if (layer.layerType === 'OpenStreetMap') {
lyr = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
Expand Down
2 changes: 1 addition & 1 deletion src/WebMapLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export var WebMap = L.Evented.extend({
},

_operationalLayer: function (layer, layers, map, params, paneName) {
var lyr = operationalLayer(layer, layers, map, params).addTo(map);
var lyr = operationalLayer(layer, layers, map, params);
if (lyr !== undefined && layer.visibility === true) {
lyr.addTo(map);
}
Expand Down
28 changes: 14 additions & 14 deletions test/arcgis-online-auth.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,30 @@
<title>Displaying Web Map</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />

<!-- Load Leaflet from CDN-->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/leaflet/1.0.0-rc.1/leaflet.css" />
<script src="https://cdn.jsdelivr.net/leaflet/1.0.0-rc.1/leaflet-src.js"></script>
<!-- Load Leaflet from CDN-->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/leaflet/1.0.0-rc.3/leaflet.css" />
<script src="https://cdn.jsdelivr.net/leaflet/1.0.0-rc.3/leaflet-src.js"></script>

<!-- Load Leaflet Label from GitHub -->
<script src="https://leaflet.github.io/Leaflet.label/leaflet.label.js"></script>

<!-- Load Esri Leaflet from CDN -->
<script src="https://cdn.jsdelivr.net/leaflet.esri/2.0.0/esri-leaflet.js"></script>
<!-- Load Esri Leaflet from CDN -->
<script src="https://cdn.jsdelivr.net/leaflet.esri/2.0.3/esri-leaflet.js"></script>

<!-- Load Leaflet Heat from CDN -->
<script src="https://rawgit.com/Leaflet/Leaflet.heat/gh-pages/dist/leaflet-heat.js"></script>

<!-- Load Heatmap Feature Layer from CDN -->
<script src="https://cdn.jsdelivr.net/leaflet.esri.heatmap-feature-layer/2.0.0-beta.1/esri-leaflet-heatmap-feature-layer.js"></script>

<!-- Load Esri Leaflet Renderers from CDN -->
<script src="//cdn.jsdelivr.net/leaflet.esri.renderers/2.0.3/esri-leaflet-renderers.js"></script>
<!-- Load Esri Leaflet Vector Tile from CDN -->
<script src="//unpkg.com/[email protected]"></script>

<!-- Load Esri Leaflet Renderers from CDN -->
<script src="//cdn.jsdelivr.net/leaflet.esri.renderers/2.0.3/esri-leaflet-renderers.js"></script>

<!-- Load Vector Icon from GitHub -->
<script src="https://muxlab.github.io/Leaflet.VectorIcon/L.VectorIcon.js"></script>
<!-- Load Vector Icon from GitHub -->
<script src="https://muxlab.github.io/Leaflet.VectorIcon/L.VectorIcon.js"></script>

<!-- Load Leaflet Omnivore from CDN -->
<script src='//api.tiles.mapbox.com/mapbox.js/plugins/leaflet-omnivore/v0.3.1/leaflet-omnivore.min.js'></script>
<!-- Load Leaflet Omnivore from CDN -->
<script src='//api.tiles.mapbox.com/mapbox.js/plugins/leaflet-omnivore/v0.3.1/leaflet-omnivore.min.js'></script>

<!-- Load L.esri.WebMap -->
<script src="../dist/esri-leaflet-webmap-debug.js"></script>
Expand Down
105 changes: 0 additions & 105 deletions test/layer-control.html

This file was deleted.

136 changes: 0 additions & 136 deletions test/twomaps.html

This file was deleted.

Loading