user3821084
user3821084

Reputation: 67

MarkerWithLabel not showing full custom icon

We are using google utility script to have a custom icon with information below it.

var marker5 = new MarkerWithLabel({position: point, 
    map: map,
    draggable: false,
    raiseOnDrag: false, 
    labelContent: infor,
    labelAnchor: new google.maps.Point(20, 0),
    labelClass: "labels",         // the CSS class for the label
    labelStyle: {opacity: 0.75},
    icon: {
      url: entImage,
      size: new google.maps.Size(30, 30),
      origin: new google.maps.Point(20, 0)
    },
    marker: MarkerWithLabel
});

The issue when we size the icon using new google.maps.Size(30, 30) it could not show up the full icon just partial of it. How ensure that when we resize it covers the whole image.

Upvotes: 1

Views: 1410

Answers (1)

user3821084
user3821084

Reputation: 67

I have managed to solve this problem via a simple way and for the benefit of the rest just create one image icon like this

var pIcon = new google.maps.MarkerImage('logo.png',
                                  null,
                  null,
                  null,
                  new google.maps.Size(30, 30));

Thereafter just apply into the rest of the codes.

Upvotes: 1

Related Questions