我正在尝试将 json 文件中的纬度和经度解析到谷歌地图上,以及将其他几个数据解析到信息窗口中。但是我认为当我尝试运行文件时,我认为可能在某个地方搞砸了,我得到的只是一个空白屏幕。有人可以指出我做错了什么。任何建议将不胜感激。
我使用了谷歌创建的地震数据作为我的参考点。
> window.eqfeed_callback = function(results) {
var bounds=new google.maps.LatLngBounds();
for (var i = 0; i < results.features.length; i++) {
var accesspoint = results.features[i];
var latitude = accesspoint.3.WifiLatitude;
var longtitude = accesspoint.4.WifiLongtitude;
var latLng = new google.maps.LatLng(latitude &&longtitude);
bounds.extend(latLng);
var content ="<div style='height:100px; width:300px; overflow:auto;'><table>";
content += "<tr><th align='left'>id</th><td>"+accesspoint.id+"</td></tr>";
content += "<tr><th align='left'>WifiMacAddress</th><td>"+accesspoint.4.WifiMacAddress+"</td></tr>";
content += "<tr><th align='left'>WifiSSID</th><td>"+accesspoint.4.WifiSSID+"</td></tr>";
content += "<tr><th align='left'>WifiFrequency</th><td>"+accesspoint.4.WifiFrequency+"</td></tr>";
content += "<tr><th align='left'>SignalStrength</th><td>"+accesspoint.4.SignalStrength+"</td></tr>";
content +="</table>";
createMarker(latLng,earthquake.id,content);
我一直在尝试解析数据的 json 文件
{"wifin":{"WifiMacAddress":["21-00-00-00-00-00"],"WifiSSID":"Edurom","WifiLatitude":[-27.501008],"WifiLongtitude":[153.011720],"WifiFrequency":"80","SignalStrength":"60"},
"wifin":{"WifiMacAddress":["21-00-00-00-00-00"],"WifiSSID":"Edurom","WifiLatitude":[-27.501541],"WifiLongtitude":[153.005755],"WifiFrequency":"80","SignalStrength":"60"},
"wifin":{"WifiMacAddress":["21-00-00-00-00-00"],"WifiSSID":"Edurom","WifiLatitude":[-27.499142],"WifiLongtitude":[153.008845],"WifiFrequency":"80","SignalStrength":"60"},
"wifin":{"WifiMacAddress":["21-00-00-00-00-00"],"WifiSSID":"Edurom","WifiLatitude":[-27.498000],"WifiLongtitude":[153.015153],"WifiFrequency":"80","SignalStrength":"60"},
"wifin":{"WifiMacAddress":["21-00-00-00-00-00"],"WifiSSID":"Edurom","WifiLatitude":[-27.495069],"WifiLongtitude":[153.011549],"WifiFrequency":"80","SignalStrength":"60"}
}