Image of what I'm seeing创建热图,但无法解决:
TypeError:data.coordinates未定义。
我将如何在此HTML文件中定义data.coordinates以及该代码在何处?
$.eventsource({
label: "json-event-source",
url: "http://localhost:5000/tweets?callback=loomit",
dataType: "json",
open: function() {
console.log( "opened" );
},
message: function( data ) {
console.log( data.coordinates.coordinates );
heatmap.addDataPoint(data.coordinates.coordinates[1], data.coordinates.coordinates[0]); //this is where I believe there's an issue
}
应使用Google Maps API显示热图