From 1eaed4fe5b7efbaa3084061df0b29b79597b747c Mon Sep 17 00:00:00 2001 From: Gavin Rehkemper Date: Wed, 10 Apr 2024 08:56:11 -0500 Subject: [PATCH 1/2] added basemap prop --- .gitignore | 2 ++ src/components.d.ts | 8 ++++++++ src/components/hub-compass-map/hub-compass-map.tsx | 8 +++++++- src/index.html | 1 + 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 3c3629e..f43bd53 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ node_modules +www +dist \ No newline at end of file diff --git a/src/components.d.ts b/src/components.d.ts index 4e46a9e..b757357 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -8,6 +8,10 @@ import { HTMLStencilElement, JSXBase } from "@stencil/core/internal"; export namespace Components { interface HubCompassMap { "addDatasetToMap": (datasetId: any) => Promise; + /** + * Basemap string Options: https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#basemap + */ + "basemap": string; /** * Optional [longitude, latitude] map center */ @@ -85,6 +89,10 @@ declare global { } declare namespace LocalJSX { interface HubCompassMap { + /** + * Basemap string Options: https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#basemap + */ + "basemap"?: string; /** * Optional [longitude, latitude] map center */ diff --git a/src/components/hub-compass-map/hub-compass-map.tsx b/src/components/hub-compass-map/hub-compass-map.tsx index 8ff132c..4d5974c 100644 --- a/src/components/hub-compass-map/hub-compass-map.tsx +++ b/src/components/hub-compass-map/hub-compass-map.tsx @@ -101,6 +101,12 @@ export class HubCompassMap { */ @Prop() session = null; + /** + * Basemap string + * Options: https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#basemap + */ + @Prop() basemap: string = "arcgis-topographic"; + /** * If map has already been saved, update it. */ @@ -228,7 +234,7 @@ export class HubCompassMap { // esriConfig.apiKey = "AAPK42ebee6b2e134974bffd492cdf7f365dXxAPfRSdf05kJ3AtuEevSfJqUEZ34Vhy2UfrxPtSXrQAfwL04Zij-GfOEQU9OD_9"; this.webMap = new WebMap({ - basemap: "arcgis-topographic" // Basemap layer service + basemap: this.basemap // Basemap layer service }); this.mapView = new MapView({ map: this.webMap, diff --git a/src/index.html b/src/index.html index 96a1b82..a239de4 100644 --- a/src/index.html +++ b/src/index.html @@ -105,6 +105,7 @@ componentEl.showSearch = true; componentEl.showTable = true; componentEl.showServiceAreas = false; + componentEl.basemap = "gray-vector"; function moveMap(center, zoom) { componentEl.center = center; From c61e5b09922a90f696beb0e1a2edcd758d82864c Mon Sep 17 00:00:00 2001 From: Gavin Rehkemper Date: Wed, 10 Apr 2024 09:00:15 -0500 Subject: [PATCH 2/2] copy gitignore from hub-compass-chat --- .gitignore | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index f43bd53..c3ea58a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,26 @@ -node_modules -www -dist \ No newline at end of file +dist/ +www/ +loader/ + +*~ +*.sw[mnpcod] +*.log +*.lock +*.tmp +*.tmp.* +log.txt +*.sublime-project +*.sublime-workspace + +.stencil/ +.idea/ +.vscode/ +.sass-cache/ +.versions/ +node_modules/ +$RECYCLE.BIN/ + +.DS_Store +Thumbs.db +UserInterfaceState.xcuserstate +.env