【发布时间】:2018-01-12 18:32:35
【问题描述】:
是否可以像 Craigslist Mapview 那样使用 MapBox 重新创建单击以放大集群?当您单击时,它会放大到包含这些位置点的区域。
这是我的聚类代码:
map.on('load', function() {
map.addSource("location", {
type: "geojson",
data: "https://s3-us-west-2.amazonaws.com/s.cdpn.io/73873/test.geojson",
cluster: true,
clusterMaxZoom: 14,
clusterRadius: 100
});
map.addLayer({
id: "clusters",
type: "circle",
source: "location",
filter: ["has", "point_count"],
paint: {
"circle-color": {
property: "point_count",
type: "interval",
stops: [
[0, "#71AAC6"],
[100, "#71AAC6"],
[750, "#71AAC6"],
]
},
"circle-radius": {
property: "point_count",
type: "interval",
stops: [
[0, 20],
[100, 30],
[750, 40]
]
}
}
});
这是我的演示
【问题讨论】:
标签: javascript mapbox mapbox-gl