gpt4 book ai didi

javascript - Google maps api v 3 - 更改自定义标记图标的来源

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:32:03 24 4
gpt4 key购买 nike

我有一个自定义标记对象,用于在谷歌地图上显示位置

        // Define custom marker object
var image = {
url: "img/crosshair.png",
size: new google.maps.Size(40, 40),
origin: new google.maps.Point(20, 20),
scaledSize: new google.maps.Size(50, 50)
};

// Create the marker
var marker = new google.maps.Marker({
position: position,
map: map
});

我的图像“crosshair.png”是一个十字准线,像这样crosshair picture (google images) .所以我自然希望标记的原点居中。

我似乎无法理解原点如何与 google maps api 中的大小相关。

如果我的标记的大小设置为 20, 20,那么居中的原点应该是 10, 10 - 这似乎不是真的。

因此,如果我有一张正方形图像并想用作 google map 标记,我应该如何将标记的原点设置为图像的中心?

最佳答案

您想更改 google.maps.Icon anchor ,而不是来源

来自 the documentation :

Properties

anchor | Type: Point

The position at which to anchor an image in correspondence to the location of the marker on the map. By default, the anchor is located along the center point of the bottom of the image.

origin | Type: Point

The position of the image within a sprite, if any. By default, the origin is located at the top left corner of the image (0, 0).

代码片段:

var geocoder;
var map;

function initialize() {
var map = new google.maps.Map(
document.getElementById("map_canvas"), {
center: new google.maps.LatLng(37.4419, -122.1419),
zoom: 13,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
// Define custom marker object
var image = {
url: crosshair,
anchor: new google.maps.Point(25, 25),
scaledSize: new google.maps.Size(50, 50)
};

// Create the marker
var marker = new google.maps.Marker({
position: map.getCenter(),
map: map,
icon: image
});

}
google.maps.event.addDomListener(window, "load", initialize);
var crosshair = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAABbGlDQ1BpY2MAAHjapdA9a1MBGMXx302Uao1UaAaHgHcoDpKC1KWj1qEgoZRYIYkuyW3eIEnDvTdIcXRwzdBFxcUqfgPdxC8gFAR10UVnBwURpMQhhYDQQTzTn3M4PA+HzLgX9ZMTl+kP0ri8vhZWqrVw7pN5p52z6EI9SobXNjd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YhLIJfLdfz7/Pz8i3w+r7LZrLJtu6Ga27atstmsyufzJ1NTUz+ilpwc/g1FEpMvW15AZQAAAABJRU5ErkJggg==";
html,
body,
#map_canvas {
height: 100%;
width: 100%;
margin: 0px;
padding: 0px
}
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCkUOdZ5y7hMm0yrcCQoCvLwzdM6M8s5qk"></script>
<div id="map_canvas"></div>

关于javascript - Google maps api v 3 - 更改自定义标记图标的来源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34001414/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com