Roman Romanchenko
Roman Romanchenko

Reputation: 21

SVG icon marker doesn't display in IE11, iPad

I use SVG sprite to create marker.

var marker = new google.maps.Marker({
    position: new google.maps.LatLng(latitude, longitude),
    map: map,
    animation: google.maps.Animation.DROP,
    zIndex: google.maps.Marker.MAX_ZINDEX + 1,
    icon: {
        url: "myServer/mysprite.svgz",
        size: new google.maps.Size(48, 51),
        origin: new google.maps.Point(9610, 0)                        
    }
})

After I init map, add marker, in IE11 it isn't appear at all. On iPad it could appear and immediately disappear.

In Chrome, FF, IE9, 10 - marker is displayed.

Could I use SVG sprite to create marker image using google maps API to support both IE11 and Safari/iPad, or any other comments?

Thanks, Roman.

Upvotes: 2

Views: 500

Answers (1)

Valery Viktorovsky
Valery Viktorovsky

Reputation: 6726

You should set scaledSize property for marker icon.

icon: {
  url: "myServer/mysprite.svgz",
  size: new google.maps.Size(48, 51),
  scaledSize: new google.maps.Size(48, 51),
  origin: new google.maps.Point(9610, 0)                        
}

Upvotes: 1

Related Questions