How to hide or disable default marker on google map with marker with placemark

I am using google map with markwithlabel and I just want to display the marker and not show the marker icon by default.

my sources:

var markerMap = new MarkerWithLabel({
      position: latLng,
      draggable: true,
      raiseOnDrag: true,
      map: map, 
      labelContent: "<div class='arrow'>1.300.000 VND</div>",
      labelAnchor: new google.maps.Point(30, 30),
      labelClass: "labels", // the CSS class for the label
      isClicked: false
});

      

result:

enter image description here

However, it displays a double badge (consists of the defeaul mark and the token tag with the mark)

I have tried many ways, but I cannot find a better way. How can I hide or disable the default google icon and just show the bullet point?

Many thanks!

+3


source to share


1 answer


You need to set the icon url to hide the default marker icon.



var markerMap = new MarkerWithLabel({
      position: latLng,
      draggable: true,
      raiseOnDrag: true,
      map: map, 
      icon: {
         url: '' // set url as ''
      }
      labelContent: "<div class='arrow'>1.300.000 VND</div>",
      labelAnchor: new google.maps.Point(30, 30),
      labelClass: "labels", // the CSS class for the label
      isClicked: false
});

      

0


source







All Articles