Ver Fonte

✨ add WMS layers

jmacura há 3 anos atrás
pai
commit
e4603937bb
1 ficheiros alterados com 36 adições e 2 exclusões
  1. 36 2
      src/app/app.service.ts

+ 36 - 2
src/app/app.service.ts

@@ -1,7 +1,7 @@
 import { Injectable, OnInit } from '@angular/core';
 
 import { GeoJSON } from 'ol/format';
-import { OSM, Vector as VectorSource } from 'ol/source';
+import { OSM, TileWMS, Vector as VectorSource } from 'ol/source';
 import { Tile, Vector as VectorLayer } from 'ol/layer';
 
 import {
@@ -131,7 +131,41 @@ export class AppService {
             removable: false,
           },
         }),
-        /* One thematic layer */
+        /* Two thematic layers */
+        new Tile({
+          properties: {
+            title: 'Available area',
+            removable: false,
+            thumbnail: 'https://www.agrihub.sk/hsl-ng/img/orto.jpg',
+          },
+          source: new TileWMS({
+            url: 'https://gis.lesprojekt.cz/geoserver/Mandolin/wms',
+            params: {
+              LAYERS: 'Mandolin_oblast',
+            },
+            attributions: [
+              //'© <a href="geoportal.cuzk.cz" target="_blank">ČÚZK</a>',
+            ],
+          }),
+          visible: false,
+        }),
+        new Tile({
+          properties: {
+            title: 'NDVI preview',
+            removable: false,
+            thumbnail: 'https://www.agrihub.sk/hsl-ng/img/orto.jpg',
+          },
+          source: new TileWMS({
+            url: 'https://gis.lesprojekt.cz/geoserver/Mandolin/wms',
+            params: {
+              LAYERS: 'Mandolin_NDVI',
+            },
+            attributions: [
+              //'© <a href="geoportal.cuzk.cz" target="_blank">ČÚZK</a>',
+            ],
+          }),
+          visible: false,
+        }),
         /*new VectorLayer({
           properties: {
             title: 'Polygon vector layer',