谷歌热图梯度范围
Google heatmap gradient range?
我得到了一个城市人的热图层,我需要在热图上对范围内的人进行排序,我如何动态更改谷歌热图梯度?
var heatMapData = [
{location: new google.maps.LatLng(37.782, -122.447), weight: 50},
new google.maps.LatLng(37.782, -122.445),
{location: new google.maps.LatLng(37.782, -122.443), weight: 20},
{location: new google.maps.LatLng(37.782, -122.441), weight: 30},
{location: new google.maps.LatLng(37.782, -122.439), weight: 20},
new google.maps.LatLng(37.782, -122.437),
{location: new google.maps.LatLng(37.782, -122.435), weight: 55},
{location: new google.maps.LatLng(37.785, -122.447), weight: 30},
{location: new google.maps.LatLng(37.785, -122.445), weight: 20},
new google.maps.LatLng(37.785, -122.443),
{location: new google.maps.LatLng(37.785, -122.441), weight: 86},
new google.maps.LatLng(37.785, -122.439),
{location: new google.maps.LatLng(37.785, -122.437), weight: 20},
{location: new google.maps.LatLng(37.785, -122.435), weight: 20}
];
var sanFrancisco = new google.maps.LatLng(37.774546, -122.433523);
map = new google.maps.Map(document.getElementById('map-canvas'), {
center: sanFrancisco,
zoom: 13,
mapTypeId: google.maps.MapTypeId.SATELLITE
});
var heatmap = new google.maps.visualization.HeatmapLayer({
data: heatMapData
});
heatmap.setMap(map);
例如:热图上我的长相从20到40不等?
使用此命令。更多信息点击这里
function changeGradient() {
var gradient = [
'rgba(0, 255, 255, 0)',
'rgba(0, 255, 255, 1)',
'rgba(0, 191, 255, 1)',
'rgba(0, 127, 255, 1)',
'rgba(0, 63, 255, 1)',
'rgba(0, 0, 255, 1)',
'rgba(0, 0, 223, 1)',
'rgba(0, 0, 191, 1)',
'rgba(0, 0, 159, 1)',
'rgba(0, 0, 127, 1)',
'rgba(63, 0, 91, 1)',
'rgba(127, 0, 63, 1)',
'rgba(191, 0, 31, 1)',
'rgba(255, 0, 0, 1)'
]
heatmap.set('gradient', heatmap.get('gradient') ? null : gradient);
}
相关文章:
- 如何通过谷歌应用程序脚本从谷歌文档中的位置确定命名范围
- 如何在谷歌电子表格脚本中测试范围参数的类型
- 谷歌电子表格-删除范围保护时出错
- 使用输入类型=“0”改变Circle谷歌地图的半径;“范围”;
- 谷歌Chrome在范围滑块禁用时卡住了's的更改功能
- 谷歌地图,Javascript可变范围
- 谷歌应用程序脚本:;范围不是函数,它是对象;尝试在单元格中放置注释时出错
- 如何创建带有多个标记的谷歌地图,从当前位置到10公里的矩形范围
- 谷歌地图api检查标记在绑定范围内
- 谷歌地图变量的范围和调用方法
- 谷歌地图或其他服务,以获取指定范围内的地方列表
- AngularJS谷歌图表:图表范围过滤器
- 谷歌脚本 - 插入具有多个范围的工作表
- 谷歌图表 - 图表范围过滤器 - 选定范围内的值
- 谷歌图表设置默认日期范围
- 与谷歌地图变量范围共同描述
- 日期范围谷歌图表工具
- 找不到范围-谷歌电子表格
- 设置查询范围谷歌图表
- 通过动态范围:谷歌脚本