0
我有數據來自Json文件,我使用markerClusterGroup創建了基於此Json文件的圖層。我打牆試圖做到這一點:選擇傳單標記
1 - 在xbt.json中選擇一些基於Json特性(「temperatura」,「salinidade」,「corrente」,「profundidade」e「geofisico」)的標記和使用的HTML選擇列表:
<select name="sometext" >
<option value="temperatura">temperatura</option>
<option value="salinidade">salinidade</option>
<option value="corrente">corrente</option>
<option value="profundidade">profundidade</option>
<option value="geofisico">geofisico</option>
</select>
基於我加入了使用彈出式廣告和makercluster(見下面的代碼)的JSON到地圖的方式,我該如何選擇(在地圖上顯示),只有相關的標誌物到特定的json功能:溫度,salinidade等?
var xbt = getJson('geojson/xbt.json');
var markers_xbt = L.markerClusterGroup();
var estacoes_xbt = L.geoJson(xbt, {
onEachFeature: function (feature, layer) //functionality on click on feature
{
layer.bindPopup("Navio: "+feature.properties.navio+"<br>"+"Comissao: "+feature.properties.comissao+"<br>"+ "Bandeira do Navio:"+feature.properties.naviobandeira+"<br>"+"Equipamento: "+feature.properties.equipamento+"<br>"+ "Inicio da Comissao:"+feature.properties.iniciocomissao+"<br>"+"Fim da Comissao : "+feature.properties.fimcomissao+"<br>"+"Data de Lancamento: "+ feature.properties.estacaodata+"<br>"+"Hora de Lancamento: " +feature.properties.estacaohora+"<br>"+"Quadrado de Marsden: "+feature.properties.quadrado+"<br>"+"Subquadrado de Marsden: "+feature.properties.subquadrado); //just to show something in the popup. could be part of the geojson as well!
}
});
markers_xbt.addLayer(estacoes_xbt); // add it to the cluster group
map.addLayer(markers_xbt); // add it to the map
map.fitBounds(markers_xbt.getBounds()); //set view on the cluster extend
親愛的iH8謝謝你的出色工作。現在請查看我的網站http://brasilgeotube.tk/,請問如何在gps json文件中使用json功能選擇特定的GPS站點。例如,在地圖上的所有圖層中,只選擇GPS站「VICO」。非常感謝你。所有的覆蓋層都會後來顯示葉片「VICO」。 – HelpOverFlow
不用了,謝謝,您隨時歡迎。但是,您可以考慮接受該答案爲有效,以便其他具有類似問題的用戶也可以找到可接受/經過測試的解決方案。請參閱:http://www.stackoverflow.com/help/someone-answers。關於你的新問題,這不是評論的內容。評論是爲了澄清問題/答案而不是詢問新問題。你應該發佈一個新的問題與相關的信息和標題。這樣別人也可以提供幫助。我會留意一下。祝你好運。 – iH8