From a6dab3ace4089fccc245b187e76bed216ead862d Mon Sep 17 00:00:00 2001 From: Patrick McKinney Date: Thu, 21 Jun 2018 10:31:33 -0400 Subject: [PATCH 1/3] add support for Firefly Imagery Basemap --- spec/Layers/BasemapLayerSpec.js | 2 +- src/Layers/BasemapLayer.js | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/spec/Layers/BasemapLayerSpec.js b/spec/Layers/BasemapLayerSpec.js index 59192b1f9..d27e62f81 100644 --- a/spec/Layers/BasemapLayerSpec.js +++ b/spec/Layers/BasemapLayerSpec.js @@ -57,7 +57,7 @@ describe('L.esri.BasemapLayer', function () { }); it('can return valid basemaps', function () { - var testmaps = ['Streets', 'Topographic', 'NationalGeographic', 'Oceans', 'OceansLabels', 'DarkGray', 'DarkGrayLabels', 'Gray', 'GrayLabels', 'Imagery', 'ImageryLabels', 'ImageryTransportation', 'ShadedRelief', 'ShadedReliefLabels', 'Terrain', 'TerrainLabels', 'USATopo', 'ImageryClarity']; + var testmaps = ['Streets', 'Topographic', 'NationalGeographic', 'Oceans', 'OceansLabels', 'DarkGray', 'DarkGrayLabels', 'Gray', 'GrayLabels', 'Imagery', 'ImageryLabels', 'ImageryTransportation', 'ShadedRelief', 'ShadedReliefLabels', 'Terrain', 'TerrainLabels', 'USATopo', 'ImageryClarity', 'ImageryFirefly']; for (var i = 0, len = testmaps.length; i < len; i++) { var name = testmaps[i]; expect(L.esri.basemapLayer(name)).to.be.instanceof(L.esri.BasemapLayer); diff --git a/src/Layers/BasemapLayer.js b/src/Layers/BasemapLayer.js index 1f4fb399f..af4fc38f3 100644 --- a/src/Layers/BasemapLayer.js +++ b/src/Layers/BasemapLayer.js @@ -183,7 +183,15 @@ export var BasemapLayer = TileLayer.extend({ maxZoom: 19, attribution: 'Esri, DigitalGlobe, GeoEye, Earthstar Geographics, CNES/Airbus DS, USDA, USGS, AeroGRID, IGN, and the GIS User Community' } - } + }, + ImageryFirefly: { + urlTemplate: tileProtocol + '//fly.maptiles.arcgis.com/arcgis/rest/services/World_Imagery_Firefly/MapServer/tile/{z}/{y}/{x}', + options: { + minZoom: 1, + maxZoom: 19, + attribution: 'Esri, DigitalGlobe, GeoEye, Earthstar Geographics, CNES/Airbus DS, USDA, USGS, AeroGRID, IGN, and the GIS User Community' + } + } } }, @@ -196,7 +204,7 @@ export var BasemapLayer = TileLayer.extend({ } else if (typeof key === 'string' && BasemapLayer.TILES[key]) { config = BasemapLayer.TILES[key]; } else { - throw new Error('L.esri.BasemapLayer: Invalid parameter. Use one of "Streets", "Topographic", "Oceans", "OceansLabels", "NationalGeographic", "Gray", "GrayLabels", "DarkGray", "DarkGrayLabels", "Imagery", "ImageryLabels", "ImageryTransportation", "ImageryClarity", "ShadedRelief", "ShadedReliefLabels", "Terrain", "TerrainLabels" or "USATopo"'); + throw new Error('L.esri.BasemapLayer: Invalid parameter. Use one of "Streets", "Topographic", "Oceans", "OceansLabels", "NationalGeographic", "Gray", "GrayLabels", "DarkGray", "DarkGrayLabels", "Imagery", "ImageryLabels", "ImageryTransportation", "ImageryClarity", "ImageryFirefly", "ShadedRelief", "ShadedReliefLabels", "Terrain", "TerrainLabels" or "USATopo"'); } // merge passed options into the config options From a372a17bc12c9c374bbddf785167d4908d8056d3 Mon Sep 17 00:00:00 2001 From: Patrick McKinney Date: Thu, 21 Jun 2018 10:47:27 -0400 Subject: [PATCH 2/3] remove trailing space from Travis failure --- src/Layers/BasemapLayer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Layers/BasemapLayer.js b/src/Layers/BasemapLayer.js index af4fc38f3..f1cacaa0d 100644 --- a/src/Layers/BasemapLayer.js +++ b/src/Layers/BasemapLayer.js @@ -191,7 +191,7 @@ export var BasemapLayer = TileLayer.extend({ maxZoom: 19, attribution: 'Esri, DigitalGlobe, GeoEye, Earthstar Geographics, CNES/Airbus DS, USDA, USGS, AeroGRID, IGN, and the GIS User Community' } - } + } } }, From 78e8db6f4c89f51961af9dec7b72264036c61c40 Mon Sep 17 00:00:00 2001 From: john gravois Date: Fri, 29 Jun 2018 16:34:09 -0700 Subject: [PATCH 3/3] ensure Firefly updates attribution dynamically --- src/Layers/BasemapLayer.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Layers/BasemapLayer.js b/src/Layers/BasemapLayer.js index f1cacaa0d..ecafc978d 100644 --- a/src/Layers/BasemapLayer.js +++ b/src/Layers/BasemapLayer.js @@ -189,7 +189,8 @@ export var BasemapLayer = TileLayer.extend({ options: { minZoom: 1, maxZoom: 19, - attribution: 'Esri, DigitalGlobe, GeoEye, Earthstar Geographics, CNES/Airbus DS, USDA, USGS, AeroGRID, IGN, and the GIS User Community' + attribution: 'Esri, DigitalGlobe, GeoEye, Earthstar Geographics, CNES/Airbus DS, USDA, USGS, AeroGRID, IGN, and the GIS User Community', + attributionUrl: 'https://static.arcgis.com/attribution/World_Imagery' } } }