0
JSON結果標記和信息框:JSON結果對谷歌地圖
[{"Company":"Company1","Country":"US","Phone":"209-555-8400","Website":"www.mywebsite.com","Latitude":35.782,"Longitude":-120.2269}, {"Company":"Company2","Country":"US","Phone":"909-555-5500","Website":"www.mywebsite.com","Latitude":36.112782,"Longitude":-111.52691}, {"Company":"Company3","Country":"US","Phone":"702-555-5200","Website":"www.mywebsite.com","Latitude":37.0427,"Longitude":-112.1818}, {"Company":"Company4","Country":"US","Phone":"602-555-5600","Website":"www.mywebsite.com","Latitude":38.4369,"Longitude":-113.8671}, {"Company":"Company5","Country":"US","Phone":"800-555-4716","Website":"www.mywebsite.com","Latitude":39.244946,"Longitude":-114.211941}]
的Javascript中查看
var locations = ["How can I get my JSON results in here"] var map = new google.maps.Map(document.getElementById('map_canvas'), { zoom: 2, center: new google.maps.LatLng(40.0, -35.0), mapTypeId: google.maps.MapTypeId.ROADMAP }); var infowindow = new google.maps.InfoWindow(); var marker, i; for (i = 0; i
我需要的是這樣的:
var locations = ['Company1 209-555-8400 US www.mywebsite.com ', 35.78, -120.23]