How to remove marker from Google map

Hi all, I just wanted to know how can I remove marker from google map.
The initial marker is the current position of the device itself and I’m working on tracking other users so need to remove the marker as soon as the admin selects another user to track.

 loadMap() {

    let mapOptions = {
      zoom: 13,
      mapTypeId: google.maps.MapTypeId.ROADMAP,
      mapTypeControl: false,
      streetViewControl: false,
      fullscreenControl: false
    } = new google.maps.Map(this.mapElement.nativeElement, mapOptions);

    this.geolocation.getCurrentPosition().then(pos => {
      let latLng = new google.maps.LatLng(pos.coords.latitude, pos.coords.longitude);;;
    }).catch((error) => {
      console.log('Error getting location', error);

  addMarker() {

    let marker = new google.maps.Marker({
      animation: google.maps.Animation.DROP,


1 Like

Thanks for your reply but I wasn’t able to use it. Any other example… if you have??

it should work.Can you show the code which remove the old marker and draw new?

1 Like

Tried this solution and it worked well :

It just makes it disappear. Thanks @mathewk :+1: