Google maps 如何在谷歌地图中隐藏聚类标记上的数字?
所以我有这个: 但我想要的是: 我很确定我可以在这里指定一个选项:Google maps 如何在谷歌地图中隐藏聚类标记上的数字?,google-maps,google-maps-markers,Google Maps,Google Maps Markers,所以我有这个: 但我想要的是: 我很确定我可以在这里指定一个选项: var options = { gridSize: 80, imagePath: imagePath , someOption : iAmMissing ?? } var mc = new MarkerClusterer(map, mapmarkers, options); google.maps.event.addListener(mc, 'clusteringend', function(){
var options = {
gridSize: 80,
imagePath: imagePath ,
someOption : iAmMissing ??
}
var mc = new MarkerClusterer(map, mapmarkers, options);
google.maps.event.addListener(mc, 'clusteringend', function(){
setTimeout(fixMyPageOnce, 1);
});
但我似乎找不到一个选择。这是正确的位置还是有其他方法可以消除圆圈中的数字?创建一个自定义“计算器”函数,将返回值的“文本”属性设置为“”
代码片段:
函数初始化(){
var center=new google.maps.LatLng(52.4357808,4.9913156999973);
变量映射选项={
缩放:12,
中心:中心,,
mapTypeId:google.maps.mapTypeId.TERRAIN
};
map=new google.maps.map(document.getElementById('map-canvas'),mapOptions);
对于(i=0;i
html,
身体,
#地图画布{
宽度:100%;
身高:100%;
}
您只需使用“样式”选项并将“文本大小”选项设置为略高于0:
var options = {
gridSize: 80,
styles: [{
url: imagePath,
height: 29,
width: 29,
anchor: [0, 0],
textSize: 0.001
}, {
url: imagePath,
height: 49,
width: 49,
anchor: [0, 0],
textSize: 0.001
}, {
url: imagePath,
width: 65,
height: 65,
anchor: [0, 0],
textSize: 0.001
}]
}
它对我有效。只需将textColor
设置为透明
var options = {
textColor: 'transparent',
gridSize: 80,
imagePath: imagePath ,
someOption : iAmMissing ??
}
var options = {
textColor: 'transparent',
gridSize: 80,
imagePath: imagePath ,
someOption : iAmMissing ??
}