Stamen

by Vladimir Vershinin

HTML

<script src="https://unpkg.com/[email protected]/dist/vue.js"></script>
<script src="https://unpkg.com/[email protected]/dist/ol.js"></script>
<script src="https://unpkg.com/[email protected]/lib/index.umd.js"></script>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/lib/style.min.css">
<script src="https://rawgit.com/icebob/fakerator/master/dist/fakerator.js"></script>
<div id="app">
  <vl-map ref="map">
    <vl-view :zoom.sync="zoom" :center.sync="center"></vl-view>
  
    <vl-layer-tile>
      <vl-source-xyz :url="stamenLayerUrl"></vl-source-xyz>
    </vl-layer-tile>
    
  </vl-map>  
</div>

CSS

html, body, #app {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

JavaScript

Vue.use(VueLayers)

new Vue({
	el: '#app',
  data () {
  	return {
    	zoom: 3,
      center: [0, 0],
      stamenLayer: 'terrain',
    }
  },
  computed: {
  	stamenLayerUrl () {
    	return `https://stamen-tiles-{a-d}.a.ssl.fastly.net/${this.stamenLayer}/{z}/{x}/{y}.jpg`
    },
  },
})