{"_id":"@txdot-gis/esri-ago-style-json","_rev":"25-84ae8675a980a6ee9c41948b3201f28a","time":{"created":"2023-10-10T18:13:02.985Z","1.0.0":"2023-10-09T20:06:36.978Z","modified":"2024-02-27T17:37:29.485Z","1.0.1":"2023-10-09T21:55:20.338Z","1.0.2":"2023-10-09T22:14:20.387Z","1.0.3":"2023-10-09T22:19:55.261Z","1.0.4":"2023-10-09T22:25:05.530Z","1.0.5":"2023-10-10T16:43:13.926Z","1.0.6":"2023-10-10T17:09:27.563Z","1.0.7":"2023-10-10T17:20:36.719Z","1.0.8":"2023-10-10T17:31:29.360Z","1.0.9":"2023-10-10T17:39:48.887Z","1.0.10":"2023-10-10T17:43:35.908Z","1.0.11":"2023-10-10T18:13:03.348Z","1.0.12":"2023-10-10T18:21:40.688Z","1.0.13":"2024-02-27T17:37:28.842Z"},"name":"@txdot-gis/esri-ago-style-json","dist-tags":{"latest":"1.0.13"},"versions":{"1.0.11":{"name":"@txdot-gis/esri-ago-style-json","version":"1.0.11","description":"ArcGIS Online vector tile basemap service Style JSON builder for default layer URL definition with relative paths.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"webpack"},"repository":{"type":"git","url":"git+https://github.com/TxDOT/esri-ago-style-json.git"},"author":{"name":"TxDOT TPP | GIM"},"license":"MIT","bugs":{"url":"https://github.com/TxDOT/esri-ago-style-json/issues"},"homepage":"https://github.com/TxDOT/esri-ago-style-json#readme","devDependencies":{"eslint":"^8.51.0","webpack":"^5.88.2","webpack-cli":"^5.1.4"},"dependencies":{"axios":"^1.5.1"},"gitHead":"790a25209ae8b3461953e23dc61379d1142f3706","_id":"@txdot-gis/esri-ago-style-json@1.0.11","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-NnEGGl44DWRY0wynFv/dsmTr8akO/LmN/yiN93N04l/XP2I9sWubsXJ3eEPobNMe40sg4FQMReZsQSzrGAu1PA==","shasum":"002684f35eef31f3a5e93d36244bbd890dc4959b","tarball":"https://registry.npmjs.org/@txdot-gis/esri-ago-style-json/-/esri-ago-style-json-1.0.11.tgz","fileCount":7,"unpackedSize":36445,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHcuSWEJk8KLp81T1Yauud8NdHFTD4SqWo6hMcVJqfpYAiEA5WE7krwXq7vDnfIUtm0H7g8QnCu3M2a1RhkODSZ0EmY="}]},"_npmUser":{"name":"txdot-gim","email":"gis@txdot.gov"},"directories":{},"maintainers":[{"name":"adambreznicky","email":"bev8@pm.me"},{"name":"txdot-gim","email":"gis@txdot.gov"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/esri-ago-style-json_1.0.11_1696961583112_0.587035478773442"},"_hasShrinkwrap":false},"1.0.12":{"name":"@txdot-gis/esri-ago-style-json","version":"1.0.12","description":"ArcGIS Online vector tile basemap service Style JSON builder for default layer URL definition with relative paths.","main":"src/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"webpack"},"repository":{"type":"git","url":"git+https://github.com/TxDOT/esri-ago-style-json.git"},"author":{"name":"TxDOT TPP | GIM"},"license":"MIT","bugs":{"url":"https://github.com/TxDOT/esri-ago-style-json/issues"},"homepage":"https://github.com/TxDOT/esri-ago-style-json#readme","devDependencies":{"eslint":"^8.51.0","webpack":"^5.88.2","webpack-cli":"^5.1.4"},"dependencies":{"axios":"^1.5.1"},"gitHead":"7e28cb73458a4d06e8e4dc5c834060802ff65497","_id":"@txdot-gis/esri-ago-style-json@1.0.12","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-riyg5XeHllcoLSilk8sbJS/0m7SJum62GakPvY0bg4FaEAzyJLDrphsTUOHKNseeBhJtsS1+CCx9+m3N0Fwchg==","shasum":"69b644f60a76e7ef36f4ea4bb49242912b0b51d1","tarball":"https://registry.npmjs.org/@txdot-gis/esri-ago-style-json/-/esri-ago-style-json-1.0.12.tgz","fileCount":7,"unpackedSize":36449,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDMKp6rlpv//Pfldod7rWr7yrWlghGbdqvSoFnkIB5fxwIhAMGBE1QITKnSaIIp/TFEsWIV3J/ojSQAnv8QchcBbzKr"}]},"_npmUser":{"name":"txdot-gim","email":"gis@txdot.gov"},"directories":{},"maintainers":[{"name":"adambreznicky","email":"bev8@pm.me"},{"name":"txdot-gim","email":"gis@txdot.gov"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/esri-ago-style-json_1.0.12_1696962100506_0.38571763169967666"},"_hasShrinkwrap":false},"1.0.13":{"name":"@txdot-gis/esri-ago-style-json","version":"1.0.13","description":"ArcGIS Online vector tile basemap service Style JSON builder for default layer URL definition with relative paths.","main":"src/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"webpack","lint":"eslint src --ext js --report-unused-disable-directives --max-warnings 0 --fix"},"keywords":["TxDOT"],"author":{"name":"TxDOT TPP | GIM"},"license":"MIT","devDependencies":{"eslint":"^8.51.0","webpack":"^5.88.2","webpack-cli":"^5.1.4"},"dependencies":{"axios":"^1.5.1"},"gitHead":"76268be30a08ccbafab650883fa88533b3936578","_id":"@txdot-gis/esri-ago-style-json@1.0.13","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-fhHXu6VV1iLe1JBYCyisZ4XmRG8bA90/+WBNvZsXxKGk6r5zKMFgsWOFDg55cHBGSGjB+iqC6dkZ5bqSbBRqxg==","shasum":"2f9ff17f30f466d983c46eb144454101f51044dd","tarball":"https://registry.npmjs.org/@txdot-gis/esri-ago-style-json/-/esri-ago-style-json-1.0.13.tgz","fileCount":7,"unpackedSize":36160,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC+uccOWBpCT2qCfoqUkuaj96IHat4WXFcWQFzc2Q+TiAiBcVnxOI7ZuWDZIgsL7y6R5bUm0whEidZtvPc8w2p9zUA=="}]},"_npmUser":{"name":"txdot-gim","email":"gis@txdot.gov"},"directories":{},"maintainers":[{"name":"adambreznicky","email":"bev8@pm.me"},{"name":"txdot-gim","email":"gis@txdot.gov"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/esri-ago-style-json_1.0.13_1709055448681_0.6761319498079374"},"_hasShrinkwrap":false}},"maintainers":[{"name":"adambreznicky","email":"bev8@pm.me"},{"name":"txdot-gim","email":"gis@txdot.gov"}],"description":"ArcGIS Online vector tile basemap service Style JSON builder for default layer URL definition with relative paths.","author":{"name":"TxDOT TPP | GIM"},"license":"MIT","readme":"# esri-ago-style-json\nArcGIS Online vector tile basemap service Style JSON builder for default layer URL definition with relative paths.\n\n## Overview\nVector tile basemaps published to, and hosted by ESRI ArcGIS Online are accessed via their generic service URL, e.g. `https://tiles.arcgis.com/tiles/KTcxiTD9dsQw4r7Z/arcgis/rest/services/TxDOT_Vector_Tile_Basemap/VectorTileServer` but when coding web maps within Javascript applications this requires using the official ESRI JS API or plugins for a Open Source or MVT standard web mapping GL.\n\nA basemap service URL like this may contain multiple styled maps to used in creating web maps. Non-default ones work as expected in Open Source web mapping GL packages because they can be accessed using their unique service layer ID within an alternative URL, e.g. `https://www.arcgis.com/sharing/rest/content/items/507a9905e7154ce484617c7327ee8bc4/resources/styles/root.json`, returning standard Vector Tile style JSON. Unfortunately, the default map of the service cannot be utilized with this serivce layer ID URL, e.g. `https://www.arcgis.com/sharing/rest/content/items/360b5af61e614182a2db9e088193be8d/resources/styles/root.json`, because it returns a 404 error; while only their generic service URL can be used to access this map. Furthermore, constructing a standard '.../resources/styles/root.json' URL using the generic service URL, e.g. `https://tiles.arcgis.com/tiles/KTcxiTD9dsQw4r7Z/arcgis/rest/services/TxDOT_Vector_Tile_Basemap/VectorTileServer/resources/styles/root.json`, we can access the default map vector tile style JSON but it utilizes relative paths and fails to render wtih web map GL packages.\n\nIn summary, the cause of issue for accessing the default map in the service:\n1. The generic service URL returns JSON metadata and not a standard JSON vector tile style object\n2. The alternative service layer ID URL (for the default map only) returns a 404 error\n3. The generic service URL permits access to the '/resources/styles/root.json' object but fails due to relative paths\n\nThis package serves to resolve this problem by accepting the generic service URL for an ESRI ArcGIS Online Vector Tile Service and returning an web map GL usable styles object. \n\n## Usage\n\n### Install\n```\nnpm install @txdot-gis/esri-ago-style-json --save\n```\n\n### Basic ES6 Usage\n```javascript\nimport { Map } from 'maplibre-gl'\nimport esriAgoStyleJson from '@txdot-gis/esri-ago-style-json'\n\nfunction buildMap() {\n    const url = 'https://tiles.arcgis.com/tiles/KTcxiTD9dsQw4r7Z/arcgis/rest/services/TxDOT_Vector_Tile_Basemap/VectorTileServer'\n    esriAgoStyleJson(url)\n    .then(styleJson => {\n\t\tconst map = new Map({\n\t\t\tcontainer: 'map',\n\t\t\tstyle: styleJson,\n\t\t\tcenter: [-99.341389, 31.132222],\n\t\t\tzoom: 9\n\t\t})\n\t})\n}\n```\n\n### Basic CDN Usage\nNotice CDN requires accessing the package subfolders via `default`\n\n```html\n<script src=\"https://unpkg.com/@txdot-gis/esri-ago-style-json@latest/dist/index.js\"></script>\n<script >\n\tconst styleJson = esriAgoStyleJson.default('https://tiles.arcgis.com/tiles/KTcxiTD9dsQw4r7Z/arcgis/rest/services/TxDOT_Vector_Tile_Basemap/VectorTileServer')\n\t.then(res => res)\n\n\t...\n</script>\n```\n\n### Response\nReturns `Promise` object which resolves to the [MVT Standard](https://github.com/mapbox/vector-tile-spec) style object, or `Error` object when failed to retrieve or parse service JSON.\n\nOnce resolved, the style object can be used for the `style` property when initiating a Map object.\n","readmeFilename":"README.md","keywords":["TxDOT"]}