webgis之Openlayer載入wmts服務

2021-10-01 12:12:19 字數 1222 閱讀 5919

終於除錯通了,,,太不容易了。。

wmts服務的部署見前面的文章,這裡主要使用openlayer來載入wmts服務

index.js檔案如下:

import 'ol/ol.css';

import map from 'ol/map';

import view from 'ol/view';

import wmtscapabilities from 'ol/format/wmtscapabilities';

import tilelayer from 'ol/layer/tile';

import osm from 'ol/source/osm';

import wmts, from 'ol/source/wmts';

var parser = new wmtscapabilities();

var map;

var req = new request('', );

fetch(req).then(function(response) ).then(function(text) );

console.log(options);

if(null == options)

map = new map()

],target: 'map',

view: new view()

});});

index.html檔案如下:

package.json如下

,

"devdependencies": ,

"scripts":

}

效果如下:

幾個重點的地方解讀:

var req = new request('', );

為wmts的服務位址

layer 為發布的圖層

下圖為預設顯示的中心點的位置以及顯示的縮放圖層。

webgis之相關工具

最近開始研究webgis相關技術,現在總體得瀏覽一下相關軟體 使用成熟的開源gis解決方案 geoserver 伺服器 tomcat 中介軟體 postgis 資料庫 udig desktop 目前支援向量瓦片展示的前端有leaflet,openlayers,arcgis js4.0。openlay...

流行的WebGIS之體驗

這能排第一的當然要數微軟的虛擬地球了!瞧瞧los angeles 3d檢視,而且可旋轉 上下調距,支援鍵盤方向鍵操作,非常適合於微調。需要安裝該3d擴充套件,並且作業系統是英文版的才支援 來看看微軟怎麼安排自己的家 可以看到每一棟樓都標註得很清楚,而且用了紅色 相信大家都使用過 google ear...

WebGIS概述 WebGIS基礎(1)

當然,我們羅列這一堆術語的本意並不是 恐嚇 讀者 恰恰相反,希望能為讀者從這堆術語的 泥淖 中尋找到一條堅實可靠的 出路。地理資訊系統 geographic information system,gis 是在20世紀60年代 2 出現的,經過近40年的發展,已經發生了重要並且意義深遠的變化。從早期昂...