Created
April 16, 2020 10:21
-
-
Save bachhm-dev/7e2027e8c740ab5e79f52c6453f8d3e5 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
<template> | |
<div id="viewDiv" class="balt-theme"></div> | |
</template> | |
<script> | |
/* eslint-disable */ | |
import { loadModules } from 'esri-loader'; | |
export default { | |
mounted() { | |
this.loadMap(); | |
}, | |
methods: { | |
loadMap() { | |
loadModules(['esri/Map', 'esri/views/MapView'], { | |
css: true | |
}) | |
.then(([ArcGISMap, MapView]) => { | |
// create map with the given options | |
const map = new ArcGISMap({ | |
basemap: 'topo-vector' | |
}); | |
// assign map to this view | |
this.view = new MapView({ | |
container: this.$el, | |
map: map, | |
center: [-118, 34], | |
zoom: 8 | |
}); | |
}); | |
} | |
} | |
} | |
</script> | |
<style> | |
/* esri styles */ | |
@import url('https://js.arcgis.com/4.4/esri/themes/light/main.css'); | |
#app { | |
font-family: Avenir, Helvetica, Arial, sans-serif; | |
-webkit-font-smoothing: antialiased; | |
-moz-osx-font-smoothing: grayscale; | |
text-align: center; | |
color: #2c3e50; | |
} | |
#nav { | |
padding: 30px; | |
} | |
#nav a { | |
font-weight: bold; | |
color: #2c3e50; | |
} | |
#nav a.router-link-exact-active { | |
color: #42b983; | |
} | |
#viewDiv { | |
position: absolute; | |
top: 3.5rem; | |
bottom: 0; | |
left: 0; | |
right: 0; | |
} | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment