From f4ebd35b40fb422d00ea4be0a56ea3d85cbe029e Mon Sep 17 00:00:00 2001 From: Bruno Caimar Date: Thu, 26 Oct 2023 10:44:37 -0300 Subject: [PATCH 1/2] Update the "Gallery" example to use v2 basemaps (#209) * fix: key can't be null * chore: change to use v2 styles --- examples/gallery-dev.html | 81 ++++++++++++--------------------------- 1 file changed, 24 insertions(+), 57 deletions(-) diff --git a/examples/gallery-dev.html b/examples/gallery-dev.html index 0600126..af62713 100644 --- a/examples/gallery-dev.html +++ b/examples/gallery-dev.html @@ -49,71 +49,38 @@ var map = L.map("map", {}).setView([34.0522, -118.2437], 15); var vectorTiles = {}; - var allEnums = [ - "ArcGIS:Imagery", - "ArcGIS:Imagery:Standard", - "ArcGIS:Imagery:Labels", - "ArcGIS:LightGray", - "ArcGIS:LightGray:Base", - "ArcGIS:LightGray:Labels", - "ArcGIS:DarkGray", - "ArcGIS:DarkGray:Base", - "ArcGIS:DarkGray:Labels", - "ArcGIS:Navigation", - "ArcGIS:NavigationNight", - "ArcGIS:Streets", - "ArcGIS:StreetsNight", - "ArcGIS:StreetsRelief", - "ArcGIS:Topographic", - "ArcGIS:Oceans", - "ArcGIS:Oceans:Base", - "ArcGIS:Oceans:Labels", - "OSM:Standard", - "OSM:StandardRelief", - "OSM:StandardRelief:Base", - "OSM:Streets", - "OSM:StreetsRelief", - "OSM:LightGray", - "OSM:LightGray:Base", - "OSM:LightGray:Labels", - "OSM:DarkGray", - "OSM:DarkGray:Base", - "OSM:DarkGray:Labels", - "ArcGIS:Terrain", - "ArcGIS:Terrain:Base", - "ArcGIS:Terrain:Detail", - "ArcGIS:Community", - "ArcGIS:ChartedTerritory", - "ArcGIS:ColoredPencil", - "ArcGIS:Nova", - "ArcGIS:ModernAntique", - "ArcGIS:Midcentury", - "ArcGIS:Newspaper", - "ArcGIS:Hillshade:Light", - "ArcGIS:Hillshade:Dark", - ]; var apiKey = "< YOUR VALID API KEY HERE >"; vectorTiles[ "Default" - ] = L.esri.Vector.vectorBasemapLayer(null, { + ] = L.esri.Vector.vectorBasemapLayer("", { apiKey }); - allEnums.forEach((enumString) => { - vectorTiles[ - enumString - ] = L.esri.Vector.vectorBasemapLayer(enumString, { - apiKey - }) - }) - - var layerControl = L.control - .layers(vectorTiles, null, { - collapsed: false - }) - .addTo(map); + L.esri.get('https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/styles/self', {}, function (error, response) { + if (error) { + console.error('Error getting the available styles. See the error details:', error); + return; + } + + response.styles.forEach((style) => { + vectorTiles[style.name] = L.esri.Vector.vectorBasemapLayer( + style.path, + { + apiKey + } + ); + }); + + L.control + .layers(vectorTiles, null, { + collapsed: false, + }) + .addTo(map); + + }); + vectorTiles["Default"].addTo(map); From 4fae9f23de9490ae98833b77e577d2a91ff3eacb Mon Sep 17 00:00:00 2001 From: Gavin Rehkemper Date: Thu, 26 Oct 2023 11:16:11 -0500 Subject: [PATCH 2/2] Update bug_report template update to a JSBIN template that uses esri-leaflet-vector v4 --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index c364c4e..6dd9499 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -17,7 +17,7 @@ body: id: reproduction attributes: label: Reproduction - description: A link to a public repository or jsbin (you can start with https://jsbin.com/zutofox/edit) that reproduces the issue, along with a step by step explanation of how to see the issue. If no reproduction case is provided within a reasonable time-frame, the issue will be closed. + description: A link to a public repository or jsbin (you can start with https://jsbin.com/jexevoy/edit) that reproduces the issue, along with a step by step explanation of how to see the issue. If no reproduction case is provided within a reasonable time-frame, the issue will be closed. placeholder: Reproduction validations: required: true