Created
February 5, 2019 21:34
-
-
Save 2Fwebd/b8e9ea6070e936d3cd8a9a02dc10dec9 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
(function() { | |
Vue.component('woffice-members-map', { | |
template: '<div id="woffice-members-map__content"></div>', | |
props: ['url', 'height'], | |
data: function () { | |
return { | |
loaded: false, | |
mapObject: null, | |
center: { | |
lat: 50.629250, | |
lng: 3.057256, | |
}, | |
zoom: 10, | |
members: [] | |
} | |
}, | |
mounted: function() { | |
this.createMap(); | |
}, | |
methods: { | |
/** | |
* Create the map and set the container's height according to the attribute | |
*/ | |
createMap: function() { | |
var $map = $('#woffice-members-map__content'); | |
$map.height(this.height); | |
this.mapObject = new google.maps.Map($map[0], { | |
center: { | |
lat: parseFloat(this.center.lat), | |
lng: parseFloat(this.center.lng) | |
}, | |
zoom: this.zoom, | |
}); | |
} | |
} | |
}); | |
new Vue({ | |
el: $('#woffice-members-map__wrapper')[0], | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment