2017-10-18 17 views
-1

Je travaille avec api google maps maintenant je suis développement avec vuejs existent maintenant posibility de lier une propriété au titre de propriété de marqueurs, par exemple ceci est mon élément sur vuejsComment lier le titre de propriété d'un marqueur à google maps avec vuejs?

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); 
    }); 
} 
}); 

Maintenant, quand je veux changez la propriété markers.title = 'Je change' et n'aboutissez à rien, les marqueurs sur les cartes gardent 'bonjour', pourriez-vous s'il vous plaît comment je fais? Si vous pouvez le faire sans utiliser la méthode native d'api google maps merci !!

Répondre