【发布时间】:2018-06-30 05:20:01
【问题描述】:
我想用 Json 文件获取 google heat map LatLng
这是我的谷歌热图功能
function initMap() {
map = new google.maps.Map(document.getElementById('map'), {
zoom: 11,
center: {lat: 37.782551, lng: -122.445368}
});
heatmap = new google.maps.visualization.HeatmapLayer({
data: getPoints(),
map: map
});
}
这是我的 LatLng 函数,我想改用 getPoints() 函数 JSON 文件
function getPoints() {
return [
new google.maps.LatLng(37.782551, -122.445368),
new google.maps.LatLng(37.782745, -122.444586),
new google.maps.LatLng(37.782842, -122.443688),
new google.maps.LatLng(37.782919, -122.442815),
new google.maps.LatLng(37.782992, -122.442112),
}
【问题讨论】:
标签: javascript json google-maps heatmap