【发布时间】:2020-03-21 09:28:03
【问题描述】:
如何根据点字段创建集群标题?
例如。我在属性中有值的点 - “计数”
当从这些点创建集群时,我希望看到带有“计数”字段总和的集群圆形文本,如下所示:
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"count": 16
},
"geometry": {
"type": "Point",
"coordinates": [
30.5419921875,
50.55532498251967
]
}
},
{
"type": "Feature",
"properties": {
"count": 2
},
"geometry": {
"type": "Point",
"coordinates": [
36.25488281249999,
50.05008477838256
]
}
}
]
}
https://docs.mapbox.com/ios/maps/examples/clustering/ 此示例从“point_count”制作文本标题 但我需要使用集群中所有点的值的总和
【问题讨论】:
-
你的问题有点不清楚,但你看到了吗? docs.mapbox.com/ios/maps/examples/clustering
-
是的。他们使用“point_count”值作为集群标题。 numbersLayer.text = NSExpression(format: "CAST(point_count, 'NSString')") 但我需要使用集群中所有点的值的总和
标签: ios swift mapbox mapbox-gl mapbox-ios