-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #333 from wearepal/shape-layer-legend
ML Layer implementation on Map View
- Loading branch information
Showing
6 changed files
with
62 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import BaseLayer from "ol/layer/Base" | ||
import { MLLayer } from "../state" | ||
import TileLayer from "ol/layer/Tile" | ||
import TileWMS from "ol/source/TileWMS" | ||
import { memoize } from "lodash" | ||
|
||
|
||
|
||
const getSourceWMS = memoize((layer: MLLayer) => | ||
new TileWMS({ | ||
url: 'https://landscapes.wearepal.ai/geoserver/wms', | ||
params: {'LAYERS': layer.layerName, 'TILED': true, 'STYLES': 'ml:treesandhedges'}, | ||
serverType: 'geoserver', | ||
imageSmoothing: false | ||
}) | ||
) | ||
|
||
|
||
export function reifyGeoserverWMSLayer (layer: MLLayer, existingLayer: BaseLayer | null) { | ||
|
||
return new TileLayer({ | ||
source: getSourceWMS(layer) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters