Javascript 更改热图上单个点的半径?

Javascript 更改热图上单个点的半径?,javascript,google-maps,google-maps-api-3,maps,heatmap,Javascript,Google Maps,Google Maps Api 3,Maps,Heatmap,以下是如何在Google Maps Api中创建热图层: var data = [ {location: new google.maps.LatLng(59.4072, 24.7053),weight:0.8}, {location: new google.maps.LatLng(59.4372, 24.7473),weight: 1}, {location: new google.maps.LatLng(59.4372, 24.7493),wei

以下是如何在Google Maps Api中创建热图层:

var data = [
        {location: new google.maps.LatLng(59.4072, 24.7053),weight:0.8},
        {location: new google.maps.LatLng(59.4372, 24.7473),weight: 1},
        {location: new google.maps.LatLng(59.4372, 24.7493),weight:0.8},
        {location: new google.maps.LatLng(59.483428, 24.841709),weight: 0.6},
        {location: new google.maps.LatLng(59.483256, 24.846666),weight: 0.2},
        {location: new google.maps.LatLng(59.409425, 27.278345),weight: 0.3}
    ];

heatmap = new google.maps.visualization.HeatmapLayer({
    data: data,
    radius: 10
});
如您所见,您必须在热图配置中指定半径。

但是如何在热图上为单个源(点)指定不同的半径?

理论上,您可以制作多个热图层

heatmap1=新建google.maps.visualization.HeatmapLayer1({ 数据:数据1, 半径:10 });

heatmap2=新建google.maps.visualization.HeatmapLayer2({ 数据:数据2, 半径:3
});

你能制作不同的“数据”数组并给它分配不同的半径吗?这是行不通的,因为最初它希望
radius
在热图配置中
var data1 = [
    {location: new google.maps.LatLng(59.4072, 24.7053),weight:0.8},
    {location: new google.maps.LatLng(59.4372, 24.7473),weight: 1},
    {location: new google.maps.LatLng(59.4372, 24.7493),weight:0.8},
    {location: new google.maps.LatLng(59.483428, 24.841709),weight: 0.6},
    {location: new google.maps.LatLng(59.483256, 24.846666),weight: 0.2},
    {location: new google.maps.LatLng(59.409425, 27.278345),weight: 0.3}
];
var data2 = [
    {location: new google.maps.LatLng(59.4072, 24.7053),weight:0.8},
    {location: new google.maps.LatLng(59.4372, 24.7473),weight: 1},
    {location: new google.maps.LatLng(59.4372, 24.7493),weight:0.8},
    {location: new google.maps.LatLng(59.483428, 24.841709),weight: 0.6},
    {location: new google.maps.LatLng(59.483256, 24.846666),weight: 0.2},
    {location: new google.maps.LatLng(59.409425, 27.278345),weight: 0.3}
];