Google Maps SVG image marker icons not showing in IE11

前端 未结 4 1003
自闭症患者
自闭症患者 2021-02-09 10:11

There is an issue on a site I have been working on that for some reason the SVG image markers are not showing up in IE 11.

I have two sets of markers:

  • the
4条回答
  •  忘掉有多难
    2021-02-09 11:15

    Actually, for me adding marker optimized: false and icon scaledSize: new google.maps.Size(25, 25) does it for me. So even if what Nick F says is true (that it's not officially supported), it works.

    SVG markers start showing up in IE11. It seems that the scaledSize adds a style width and height on the element, unsure what optimized does in this case.

    Example:

            var marker = new google.maps.Marker({
                map: map,
                position: poi.geometry.location,
                title: poi.name,
                zIndex: 99,
                optimized: false,
                icon: {
                    url: 'loremipsum.svg',
                    scaledSize: new google.maps.Size(25, 25),
                    size: new google.maps.Size(25, 25),
                    origin: new google.maps.Point(0, 0),
                    anchor: new google.maps.Point(12.5, 12.5)
                }
            });
    

    Credit: Google Maps SVG marker doesn't display on IE 11

提交回复
热议问题