0

我目前正在使用 geoXML3 工具在 Google 地图上放置自定义标记。我对这一切的运作方式以及即时生成 KML 并将标记显示在我的地图上的便利性感到非常满意。

由于我的标记是自定义的,因此每个标记的“原点”不一定相同。当标记放置在地图上时,KML 是否可以指定用作原点的像素位置?

例如,我所有的自定义标记都是 32x32 PNG。但实际可见图像是 8x24,以 32x32 区域为中心。我希望此标记的原点为 (16,28),以便可见图像的底部放置在 KML Placemark 属性中指定的点处。

有任何想法吗?

4

1 回答 1

3

在 KML 中定义它的方法是使用热点标签

<hotSpot x="0.5" y="0.5" xunits="fraction" yunits="fraction">
    Specifies the position within the Icon that is "anchored" to the <Point> specified in the Placemark. The x and y values can be specified in three different ways: as pixels ("pixels"), as fractions of the icon ("fraction"), or as inset pixels ("insetPixels"), which is an offset in pixels from the upper right corner of the icon. The x and y positions can be specified in different ways—for example, x can be in pixels and y can be a fraction. The origin of the coordinate system is in the lower left corner of the icon.

        x - Either the number of pixels, a fractional component of the icon, or a pixel inset indicating the x component of a point on the icon.
        y - Either the number of pixels, a fractional component of the icon, or a pixel inset indicating the y component of a point on the icon.
        xunits - Units in which the x value is specified. A value of fraction indicates the x value is a fraction of the icon. A value of pixels indicates the x value in pixels. A value of insetPixels indicates the indent from the right edge of the icon.
        yunits - Units in which the y value is specified. A value of fraction indicates the y value is a fraction of the icon. A value of pixels indicates the y value in pixels. A value of insetPixels indicates the indent from the top edge of the icon.
于 2013-03-20T15:14:43.613 回答