leaflet 添加featureLayer 並自定義樣式


 1             let url = "https://xxx.arcgis.com/arcgis/rest/services/line_0706_3857/FeatureServer/0"; //此處為地址樣式,不是完整的地址,請填寫服務的完整地址。
 2                         
 3             var LineLayer = esri.featureLayer({
 4                 url: url,
 5                 style: function (feature) {
 6                     var c = '#007D7D';;
 7                     var o = 0.95;
 8                     let width = 3;
 9                     let gj = feature.properties.lineGJ;
10 
11                     if (gj > 0 && gj < 201) {
12                         width = 3
13                     } else if (gj < 200 && gj < 401) {
14                         width = 5;
15                     } else if (gj > 400) {
16                         width = 7;
17                     }
18 
19                     return { color: c, opacity: o, weight: width };
20                 }
21             }).addTo(map);

 

 


免責聲明!

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



猜您在找 leaflet天地圖GeoJSON邊界添加自定義背景 QTabWidget添加自定義樣式 Joomla - 自定義(自定義模塊、修改原有模塊樣式、添加全局JS) vue 動態添加