Hello what happens is that I am adding a marker but when the lat is changed and lng adds me another marker.
How do I do to update only the marker and do not create me markers?
loadMap(lat,lng){
let location : LatLng= new LatLng(lat,lng)
this.map=new GoogleMap('map',{
'controls':{
'compass':true,
'myLocationButton':true,
'indoorPiker':true,
'zoom':true
},
'gestures':{
'scroll':true,
'tilt':true,
'rotate':true,
'zoom':true
},
'camera':{
'latLng':location,
'tilt':30,
'zoom':15,
'bearing':50
}
})
this.choferA.forEach(marker=>{
this.addMarker(marker.lat,marker.lng);
console.log("esto es:"+marker)
});
}
addMarker(lat,lng){
let markerOptions: MarkerOptions = {
position: new LatLng(lat,lng),
icon:'www/assets/img/busA.png',
// title: this.chofer.ruta
};
this.map.addMarker(markerOptions);
}