因此,当前我在代码中为两种类型的符号制作两个符号层和GeoJsonSource-一组符号处于活动状态,另一组符号处于非活动状态。我这样做是因为我有两组符号,因此,我制作了两个GeoJsonSource。
val source_Active = GeoJsonSource("GeoJsonSourceActive", FeatureCollection.fromFeatures(listoflnglat_active),GeoJsonOptions().withCluster(true).withClusterMaxZoom(16).withClusterRadius(40))
val source_Passive = GeoJsonSource("GeoJsonSourcePassive", FeatureCollection.fromFeatures(listoflnglat_passive),GeoJsonOptions().withCluster(true).withClusterMaxZoom(16).withClusterRadius(40))
style.addSource(source_Active)
style.addSource(source_Passive)
val symbolLayerActive = SymbolLayer("Active","GeoJsonSourceActive")
val symbolLayerPassive = SymbolLayer("Passive","GeoJsonSourcePassive")
symbolLayerActive.withProperties(PropertyFactory.iconImage("marker-icon-active"))
symbolLayerPassive.withProperties(PropertyFactory.iconImage("marker-icon-passive"))
style.addLayer(symbolLayerActive)
style.addLayer(symbolLayerPassive)
我可以在单个图层中执行此操作吗,因为我想执行聚类并且希望所有图标在经过一定程度的缩小后都聚集成一个图标