0
大家好,並提前感謝您的意見和建議。過濾器查詢融合表不工作
1 - 我有過濾以可下載和公共表「1wPUbMMUyZQkrodr7zk6-_mYJmH4RPc48NvDuzBY」
2兩列(信道和扇區)的問題 - 從表樣式並不在地圖上顯示。
這是我使用的代碼。請隨時諮詢或更正。
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>Malawi EN</title>
<!-- Style -->
<style>
body { font-family: Arial, sans-serif; }
#map_canvas { height: 700px; width:1056px; }
</style>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
var tableid = "1wPUbMMUyZQkrodr7zk6-_mYJmH4RPc48NvDuzBY";
var layer = new google.maps.FusionTablesLayer(tableid);
function initialize() {
map = new google.maps.Map(document.getElementById('map_canvas'), {
center: new google.maps.LatLng(-13.731381,34.002686),
zoom: 7,
mapTypeControl: true,
panControl: false,
zoomControl: true,
zoomControlOptions: {
style: google.maps.ZoomControlStyle.SMALL
},
mapTypeId: google.maps.MapTypeId.ROADMAP,
streetViewControl:false
});
layer.setMap(map);
}
//Change the query based on the user's selection
function changeMap(sector, channel) {
sector = document.getElementById('sector').value;
channel = document.getElementById('channel').value;
layer.setQuery("SELECT lat FROM " + tableid + " WHERE sector MATCHES '%" + sector + "%' AND channel MATCHES '" + channel + "'");
}
</script>
</head>
<body onLoad="initialize();">
<h3>Malawi</h3>
Channel of Aid: <select id="channel" onChange="changeMap();">
<option value="%"> All </option>
<option value="bilateral">Bilateral</option>
<option value="multilateral">Multilateral</option>
<option value="partnership">Partnership</option>
</select>
Sector: <select id="sector" onChange="changeMap();">
<option value="%"> All </option>
<option value="Improving health">Improving health</option>
<option value="Private sector development">Private sector development</option>
<option value="Environment">Environment</option>
<option value="Democratic governance">Democratic governance</option>
<option value="Strengthening basic education">Strengthening basic education</option>
<option value="Peace and security">Peace and security</option>
<option value="Emergency assistance">Emergency assistance</option>
<option value="Other">Other</option>
</select>
<div id="map_canvas"></div>
</body>
</html>
非常感謝您對看代碼,並協助我一個答案,我真的很感謝您的幫助! – user1214134
@ user1214134如果這個答案對您有幫助,請考慮[接受它](http://stackoverflow.com/help/accepted-answer)。 – Odi