forked from xkjyeah/vue-google-maps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbasic-kml-layer.html
39 lines (34 loc) · 1.08 KB
/
basic-kml-layer.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<body>
<div id="root">
<google-map :center="center" :zoom="7" style="width: 100%; height: 500px">
<google-kml-layer v-for="l in kmlLayers" :url="l.url" :clickable="true"></google-kml-layer>
</google-map>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.0/vue.js"></script>
<script src="vue-google-maps.js"></script>
<script>
Vue.use(VueGoogleMaps, {
load: {
key: 'AIzaSyDf43lPdwlF98RCBsJOFNKOkoEjkwxb5Sc'
},
// Demonstrating how we can customize the name of the components
installComponents: false,
});
document.addEventListener('DOMContentLoaded', function() {
Vue.component('google-map', VueGoogleMaps.Map);
Vue.component('google-kml-layer', VueGoogleMaps.KmlLayer);
new Vue({
el: '#root',
data: {
center: {
lat: -19.257753,
lng: 146.823688
},
kmlLayers: [{
url: 'https://developers.google.com/maps/documentation/javascript/examples/kml/westcampus.kml'
}]
},
});
});
</script>
</body>