我想显示从绿色到红色的不同强度的数据点(Google Maps Swift)。地图上数据点的面积应保持不变。 GMUWeightedLatLng 类将坐标和强度作为参数。 然而,后者代表那个特定点的面积,它不会改变颜色。
import builtins
from symspellpy import SymSpell
try:
if builtins.sym_spell:
print('sym_spell is already loaded!')
sym_spell = builtins.sym_spell
except:
print('sym_spell is not yet loaded! loading sym_spell...')
sym_spell = SymSpell(max_dictionary_edit_distance=5,prefix_length=7)
sym_spell.load_pickle('symspell.pkl')
builtins.sym_spell = sym_spell
heatmapLayer.gradient 提供了更改渐变的可能性,但它使所有数据点的渐变都相同,而我希望每个点都显示从绿色到红色的自定义阴影,具有相同的面积。
let coords = GMUWeightedLatLng(coordinate: CLLocationCoordinate2DMake(latitude,longitude),intensity: 1)
heatmapLayer.weightedData.append(coords)
非常感谢您的帮助!