Open caiooaugusto opened 7 years ago
center map is not working too
<gmap-map
class='google-maps'
:center="center"
watch: { '$route'(to, from) { // Call resizePreserveCenter() on all maps Vue.$gmapDefaultResizeBus.$emit('resize') }, position(position){ this.center.lat = position[1].subtitle this.center.lng = position[3].subtitle
sorry, i solved it, i just forgot change correct data assigment
but i cant center the map, and cant set markest content info window :(
for(var index = 0; index < data.length; index++) {
this.markers.push({
lat: data[index].latitude,
lng: data[index].longitude,
historyId: data[index].history_id
})
}
<gmap-marker
:key="index"
v-for="(m, index) in markers"
:position="m"
:clickable="true"
:draggable="true"
@click="center=m"
></gmap-marker>
To center... is subtitle a string or an int? do you get error messages in your console?
You need to use a GmapInfoWindow to set infowindow contents.
this.markers.push({
lat: data[index].latitude,
lng: data[index].longitude,
historyId: data[index].history_id
})
That won't work because lat and lng need to be a position so it should be:
this.markers.push({
position: {
lat: data[index].latitude,
lng: data[index].longitude
},
historyId: data[index].history_id
})
I'm trying to get the instanced <gmap-map in this code and display positions fetched from webservice but i think its reference is not right. Some one know how could i do that?