業界無數好評、全省廠房拆除、裝潢拆除
舊屋翻修等工程服務,報價透明,效率快。
台北通馬桶系統家具櫥櫃設計製作專家,舉凡客廳
書房、臥室等皆可適用,歡迎洽詢

首頁  •  tw 論壇 • 程式設計討論     • 

[AJAX] google map GDownloadUrl

房東:小蛙
發表時間:2011-12-16
[檢舉]


function changeme(){

var map; //clears current icons

//get the value of each input:
var e = document.getElementById(\"sport\");
var strUser = e.options[e.selectedIndex].value;

var event = document.getElementById(\"event\");
var strUserevent = event.options[event.selectedIndex].value;

var price = document.getElementById(\"price\");
var strUserprice = price.options[price.selectedIndex].value;

var miles = document.getElementById(\"miles\");
var strUsermiles = miles.options[miles.selectedIndex].value;

var zip = document.getElementById(\"zip\");
var strUserzip = document.getElementById(\'zip\').value;

xmlurlsport = \"?sport=\"+ strUser +\"\";
xmlurlevent = \"&event=\"+ strUserevent +\"\";
xmlurlprice = \"&price=\"+ strUserprice +\"\";
xmlurlmiles = \"&miles=\"+ strUsermiles +\"\";
xmlurlzip = \"&zip=\"+ strUserzip +\"\";

var xmlurl = \"http://michaelstevens.dyndns.org/athletenation/components/com_athletenation/views/Events/tmpl/xml.php\"+xmlurlsport+\"\"+xmlurlevent+\"\"+xmlurlprice+\"\"+xmlurlmiles+\"\"+xmlurlzip+\"\";


var map = new GMap2(document.getElementById(\"map\"));
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng(38.85682, -96.943359), 4);


GDownloadUrl(xmlurl, function(data) {
var xml = GXml.parse(data);
var markers = xml.documentElement.getElementsByTagName(\"marker\");
for (var i = 0; i < markers.length; i++) {
var name = markers[i].getAttribute(\"name\");
var address = markers[i].getAttribute(\"address\");
var type = markers[i].getAttribute(\"type\");
var title = markers[i].getAttribute(\"title\");
var id = markers[i].getAttribute(\"id\");
var point = new GLatLng(parseFloat(markers[i].getAttribute(\"lat\")),
parseFloat(markers[i].getAttribute(\"lng\")));
var marker = createMarker(point, name, address, type, title, id);
map.addOverlay(marker);
}
});




alert(xmlurl);

}



  • 贊助網站       

    廣利不動產-板橋在地生根最實在--新板特區指名度最高、值得您信賴的好房仲
    完整房訊,房屋、店面熱門精選物件,廣利不動產 優質仲介,房屋租賃、買賣資訊透明,交易真安心!
    廣利不動產-新板特區指名度最高、值得您信賴的好房仲
    您的托付,廣利用心為您服務



  •  共 0 人回應

    姓名:
    佈告內容: