leaflet加載wmts服務和wfs服務


一,加載wmts服務

以下配置僅限於與天地圖層級相同

  
//比例尺
const matrixIds = [];
      for (let i = 0; i < 20; ++i) {
        matrixIds[i] = {
          identifier: "" + (i + 1),
          // identifier: "" + (i + 1),
          topLeftCorner: new L.LatLng(90, -180)
        };
      } 

Layer = new L.TileLayer.WMTS("https://mapservice.tdtah.cn/server1/rest/services"l, {
        layer:"DOM2015",//名稱
        style: "default",//樣式
        tilematrixSet: config.tilematrixSet,
        format:  "image/png",
        matrixIds: "default",
        attribution: "4490",
      }).addTo(map);

天地圖層級級別

 

二、WFS服務加載

此服務與wmts服務不同  ,返回的是沒有樣式的數據,類似於geojson數據,用get請求返回數據

url:https://mapservice.tdtah.cn/server1/services/rootline/MapServer/WFSServer
參數:
{
request:"GetFeature",//請求方式
service:"WFS",//服務形式
outputFormat:"GEOJSON",//返回數據格式
typeName:"rootline"
}

查詢方式具體參數可參考

https://mapservice.tdtah.cn/server1/rest/services/rootline/MapServer/0/query

 


免責聲明!

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



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