Skip to content

Instantly share code, notes, and snippets.

@odoe
Created March 28, 2019 21:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save odoe/591613db2dd16cfc722a69c605fe18ee to your computer and use it in GitHub Desktop.
Save odoe/591613db2dd16cfc722a69c605fe18ee to your computer and use it in GitHub Desktop.
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