如前所述“Geocodezip”,谷歌不共享技术在他们的标记添加标签。你必须添加你自己的。 markerwithlabel'basic.html'示例在这里解决了我的问题。它允许你添加标记 我编辑了一下代码以便能够添加多个标记/标记对
var image = {
url: './customMarker.jpg',
// This marker is 20 pixels wide by 32 pixels high.
size: new google.maps.Size(100, 100),
// The origin for this image is (0, 0).
origin: new google.maps.Point(0, 0),
// The anchor for this image is the base of the flagpole at (0, 32).
anchor: new google.maps.Point(0, 32)
};
var NewLabels=[
['Test2', 34.03, -118.235],
['Test1', 35.03, -117.235],
['Test2', 36.03, -116.235],
['Test3', 37.03, -115.235],
['Test4', 38.03, -114.235],
];
for (var i = 0; i < NewLabels.length; i++) {
var title = NewLabels[i][0];
var title = new MapLabel({
text: NewLabels[i][0],
position: new google.maps.LatLng(NewLabels[i][1], NewLabels[i][2]),
map: map,
fontSize: 20,
align: 'right'
});
var marker = new google.maps.Marker({animation: google.maps.Animation.DROP, icon: image,});
marker.bindTo('map', title);
marker.bindTo('position', title);
marker.setDraggable(true);
};
它不受本地API支持。 [MarkerWithLabel](http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerwithlabel/docs/examples.html)可能是最接近第三方的图书馆,您可以调整风格“标签”分区。或者您可以尝试[MapLabel](https://github.com/googlemaps/js-map-label) – geocodezip
不确定这是否有帮助,但您可以使用Google注册位置,并最终会在地图上本地显示。 – GreatBlakes
尝试使用'label','title'用于翻页文本,并且没有基于[Marker]的文本属性(https://developers.google.com/maps/documentation/javascript/3.exp/reference#Marker)资源。 'text'是MarkerLabel资源的一部分 – adjuremods