代码之家  ›  专栏  ›  技术社区  ›  Matt

在google maps api应用程序上拉伸的Placemark图像

  •  1
  • Matt  · 技术社区  · 15 年前

    有没有其他人经历过一个自定义的位置标记被垂直拉伸并找到了解决方案?

    例子: http://www.mattpotts.com/so-stretched.png

    这就是我的代码:

    var blueIcon = new GIcon(G_DEFAULT_ICON);
    blueIcon.image = "images/beer-24x24.png";
    var marker = new GMarker(point, {draggable:true, icon:blueIcon})
    1 回复  |  直到 15 年前
        1
  •  2
  •   Roman Nurik    15 年前

    听起来您想设置:

    blueIcon.size = new GSize(24, 24);
    

    以及自定义的其他属性 GIcon . 拉伸是因为 G_DEFAULT_ICON 是典型的地图别针,类似于20x32。

    推荐文章