Vue
by Michael Underwood
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.6.0/leaflet.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Vue2Leaflet/1.0.2/vue2-leaflet.min.js"></script>
<script src="https://raw.githubusercontent.com/noerw/leaflet-sidebar-v2/master/js/leaflet-sidebar.js"></script>
<link rel="stylesheet" href="//unpkg.com/leaflet/dist/leaflet.css" />
<div id="app">
<l-map>
<l-tile-layer
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
attribution="© <a href='http://osm.org/copyright'>OpenStreetMap</a> contributors"
/>
</l-map>
</div>
CSS
body {
background: #20262E;
padding: 20px;
font-family: Helvetica;
}
#app {
background: #fff;
border-radius: 4px;
padding: 20px;
transition: all 0.2s;
width: 90%;
height: 400px;
}
li {
margin: 8px 0;
}
h2 {
font-weight: bold;
margin-bottom: 15px;
}
del {
color: rgba(0, 0, 0, 0.3);
}
Vue
const { LMap, LTileLayer, LMarker } = Vue2Leaflet;
new Vue({
el: "#app",
components: {
LMap,
LTileLayer,
},
})