-1
내가 지금이 내가 원하는 이제 vuejsvuejs가있는 Google지도에서 마커의 속성 제목에 바인딩하는 방법은 무엇입니까? 내가 API를 구글에서 함께 일하고
Vue.component('root-map',{
template: `
<div id="sidebar_builder"
style="width: 100%; height: 600px;">
</div>
`,
data: function(){
return {
map:null,
marker:{
title: 'hello'
}
}
},
mounted: function() {
this.$nextTick(function() {
var myLatlng = new google.maps.LatLng(-25.363882,131.044922);
var mapOptions = {
zoom: 4,
center: myLatlng
};
this.map = new google.maps.Map(document.getElementById('sidebar_builder'),mapOptions);
var marker_icon= new google.maps.Marker({
position: myLatlng,
title: this.marker.title}); // the most important part
marker_icon.setMap(this.map);
});
}
});
을 내 구성 요소는 예를 를 들어, 마커의 속성 제목 속성 바인딩에서있는 posibility 존재 vuejs와 개발을 나는 지금 매핑 markers.title = '나는 바뀐다'속성을 변경하십시오.지도에있는 마커는 '안녕하세요'를 유지합니다. 어떻게 할 수 있습니까? 만약 API를 사용하지 않고 그것을 할 수 있다면 구글 맵 감사합니다!