-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
農地圖層即時改寫: 把農地的遮罩換成國土測繪雲 -> 疑似工廠的圖層 #67
Comments
@DotSea 用這套 baseLayer.setFilter(function () {
new L.CanvasFilter(this, {
channelFilter: function (imageData) {
return new L.CanvasChannelFilters.Colorize(imageData, {
values: [100, 100]
}).render();
}
}).render();
}); |
diff --git a/src/lib/image.ts b/src/lib/image.ts
index 0ae73a3..8f48fbc 100644
--- a/src/lib/image.ts
+++ b/src/lib/image.ts
@@ -49,7 +49,8 @@ export const toGrayScale = createImageProcessor(data => {
})
const argriculturalLandColors = [
- [255, 241, 0]
+ // [255, 241, 0],
+ [255, 0, 0]
]
const isArrayEqual = (a: Array<any>, b: Array<any>) => !a.some((v, i) => b[i] !== v)
diff --git a/src/lib/map.ts b/src/lib/map.ts
index 2f41306..e6f367b 100644
--- a/src/lib/map.ts
+++ b/src/lib/map.ts
@@ -337,23 +337,24 @@ const getBaseLayer = (type: BASE_MAP, wmtsTileGrid: WMTSTileGrid) => {
})
case BASE_MAP.TAIWAN:
return new WMTS({
- matrixSet: 'EPSG:3857',
+ matrixSet: 'EPSG:4326',
format: 'image/png',
- url: 'https://wmts.nlsc.gov.tw/wmts',
- layer: 'EMAP',
+ url: 'https://data.csrsr.ncu.edu.tw/SP/SP2017NC_3857/{TileMatrix}/{TileCol}/{TileRow}.png',
+ layer: 'SP',
tileGrid: wmtsTileGrid,
crossOrigin: 'Anonymous',
style: 'default',
+ requestEncoding: 'REST',
wrapX: true,
attributions:
'<a href="https://maps.nlsc.gov.tw/" target="_blank">國土測繪圖資服務雲</a>'
})
case BASE_MAP.SATELITE:
return new WMTS({
- matrixSet: 'EPSG:3857',
+ matrixSet: 'EPSG:4326',
format: 'image/png',
- url: 'https://wmts.nlsc.gov.tw/wmts/PHOTO_MIX/default/EPSG:3857/{TileMatrix}/{TileRow}/{TileCol}',
- layer: 'EMAP',
+ url: 'https://data.csrsr.ncu.edu.tw/SP/SP2020NC_3857/{TileMatrix}/{TileCol}/{TileRow}.png',
+ layer: 'SP',
tileGrid: wmtsTileGrid,
requestEncoding: 'REST',
crossOrigin: 'Anonymous',
@@ -382,9 +383,11 @@ const getBaseLayer = (type: BASE_MAP, wmtsTileGrid: WMTSTileGrid) => {
const getLUIMapLayer = (wmtsTileGrid: WMTSTileGrid) => {
return new TileLayer({
source: new WMTS({
+ // matrixSet: 'EPSG:3857',
matrixSet: 'EPSG:3857',
format: 'image/png',
- url: 'https://wmts.nlsc.gov.tw/wmts/nURBAN2/default/EPSG:3857/{TileMatrix}/{TileRow}/{TileCol}',
+ // url: 'https://wmts.nlsc.gov.tw/wmts/nURBAN2/default/EPSG:3857/{TileMatrix}/{TileRow}/{TileCol}',
+ url: 'https://map.coa.gov.tw/server/rest/services/FarmlandSurvey/L13_109/MapServer/tile/{TileMatrix}/{TileRow}/{TileCol}',
layer: 'LUIMAP',
requestEncoding: 'REST',
tileGrid: wmtsTileGrid,
|
|
後來的解法: extend Leaflet TileLayer 的 createTile,把 url 轉換 |
可以用來做遮罩測試的題目 @dyfu95 編號 │經度 │緯度 │地號 |
條件: |
https://stackoverflow.com/questions/37447457/dynamically-reload-leaflet-tiles
vs openlayer https://github.com/Disfactory/frontend/blob/df24ba632041d9f39bb5360a62e88c953b7ebaa9/src/lib/map.ts#L391-L397
The text was updated successfully, but these errors were encountered: