小编Dmi*_*nov的帖子

如何在Google地图自定义图标中添加圆形?

我在地图上有自定义图像的问题.

例如:我的图标以这种方式生成,图标包含图像:

 var ic = { //icon
        url: icon, // url
        scaledSize: new google.maps.Size(30, 30), // scaled size
        origin: new google.maps.Point(0,0), // origin
        anchor: new google.maps.Point(0, 0), // anchor
        //define the shape
        //define the shape
        shape:{coords:[17,17,18],type:'circle'},
        //set optimized to false otherwise the marker  will be rendered via canvas
        //and is not accessible via CSS
        optimized:false,
        title: 'spot'

    };

    var marker = new google.maps.Marker({
        map: map, title: name , position: latlngset, icon: ic
    });
Run Code Online (Sandbox Code Playgroud)

我想让我的图标像css 50%半径(圆形).我怎么能这样做?

google-maps

-1
推荐指数
2
解决办法
4911
查看次数

标签 统计

google-maps ×1