假设我理解这一点 - 基本上你有一些基于会话的数据类型 # 你想在那个经纬度配对上画一个更大或更小的圆圈。
您可以做的是最初导入数据,然后获取会话数并物理创建一组以在地图上呈现(某种类型的数组或其他东西)。您可以使用地图框标记来渲染这些图标或圆圈,并为它们物理分配大小。
在此之前,您必须预先确定一个函数来获取会话数并将它们映射到物理半径值 - 比如说 1000 个会话 = 10 的半径和 50,000 个会话 = 500 的半径。
例如,在我创建的一个 ios 应用程序中,这是我的代码,使用 - https://github.com/mapbox/react-native-mapbox-gl
markersArray = markersArray.concat({
coordinates:[bList[i].latitude, bList[i].longitude],
'type': 'point',
title: bList[i].bname,
subtitle: bList[i].data,
id: bList[i].o_ID.toString(),
startTime: bList[i].startTime,
endTime: bList[i].endTime,
annotationImage: {
url: (bList[i].type === 'drink') ? (drinkUrl) : (foodUrl),
height: 30,
width: 30
},
rightCalloutAccessory: {
url: 'image!info-icon',
height: 20,
width: 20
}
});