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