Skip to content

Commit

Permalink
Merge pull request #1 from esridc/basemap-prop
Browse files Browse the repository at this point in the history
Basemap prop
  • Loading branch information
ajturner authored Nov 12, 2024
2 parents cca963c + 95d3348 commit 4686304
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 2 deletions.
27 changes: 26 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,26 @@
node_modules
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
8 changes: 8 additions & 0 deletions src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import { HTMLStencilElement, JSXBase } from "@stencil/core/internal";
export namespace Components {
interface HubCompassMap {
"addDatasetToMap": (datasetId: any) => Promise<void>;
/**
* Basemap string Options: https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#basemap
*/
"basemap": string;
/**
* Optional [longitude, latitude] map center
*/
Expand Down Expand Up @@ -89,6 +93,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
*/
Expand Down
8 changes: 7 additions & 1 deletion src/components/hub-compass-map/hub-compass-map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,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.
*/
Expand Down Expand Up @@ -267,7 +273,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,
Expand Down
1 change: 1 addition & 0 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
componentEl.showSearch = true;
componentEl.showTable = true;
componentEl.showServiceAreas = false;
componentEl.basemap = "gray-vector";

function moveMap(center, zoom) {
componentEl.center = center;
Expand Down

0 comments on commit 4686304

Please sign in to comment.