Created
March 28, 2019 21:01
-
-
Save odoe/591613db2dd16cfc722a69c605fe18ee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
initializeMap = async (container: HTMLElement) => { | |
loadCss('https://js.arcgis.com/4.10/esri/css/main.css'); | |
const [MapView, WebMap] = await loadModules(['esri/views/MapView', 'esri/WebMap']); | |
// then we load a web map from an id | |
const webmap = new WebMap({ | |
portalItem: { | |
id: this.webmapid | |
} | |
}); | |
// and we show that map in a container w/ id #viewDiv | |
const view = new MapView({ | |
map: webmap, | |
container: container | |
}); | |
view.when().then(() => { | |
console.log('map is ready'); | |
this._invalidator(); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment