小编col*_*lin的帖子

Google Maps API v3热图错误:"无法读取未定义的属性'HeatmapLayer'"

我正在尝试将Heatmaps图层加载到我的谷歌地图上,但出于某种原因,我只是不断收到错误"无法读取未定义的属性'HeatmapLayer'."

map = new google.maps.Map(document.getElementById("gmaps"),{
    zoom: 11,
    center: new google.maps.LatLng(39.788403, -86.19990800000001),
    mapTypeControl: false,
    streetViewControl: false,
    mapTypeId: google.maps.MapTypeId.ROADMAP,
    panControl: false
});

heatMapData = [
new google.maps.LatLng(39.77745056152344, -86.10900878906250),
new google.maps.LatLng(39.82060623168945, -86.17008972167969),
new google.maps.LatLng(39.77947616577148, -86.17008972167969),
new google.maps.LatLng(39.82987594604492, -86.13955688476562),
new google.maps.LatLng(39.74195098876953, -86.12429046630860)
];
heatmap = new google.maps.visualization.HeatmapLayer({
    data: heatMapData,
    map: map
});
Run Code Online (Sandbox Code Playgroud)

这是jsFiddle:http://jsfiddle.net/9HQ2a/3/

javascript jquery google-maps heatmap google-maps-api-3

8
推荐指数
1
解决办法
8270
查看次数