mapbox FillLayer與LineLayer 線與面的轉換,提取邊界線


在mapbox里面線與面可以進行轉換,比如你需要提取一個面的邊界線,

你僅需要將 FillLayer換成LineLayer即可,反之亦然。

比如:

    這是一個面:
GeoJsonSource jsonSource = new GeoJsonSource("keqioa_source", geojson);
mMapbox.getStyle().addSource(jsonSource);
FillLayer fillLayer = new FillLayer("keqioa_layer", "keqioa_source");
fillLayer.setProperties(
, fillColor(Color.WHITE)
,fillOpacity(0.3f));
提取邊界線:
LineLayer fillLayer=new LineLayer("keqioa_layer", "keqioa_source").withProperties(
lineColor(ContextCompat.getColor(GuDaoMapActivity1.this, R.color.colorAuxiliary)), lineWidth(3.0f));
mMapbox.getStyle().addLayer(fillLayer);
沒錯,就是這么簡單粗暴。



免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM