Skip to content

Commit 5abc028

Browse files
committed
ol-stac migration #531
1 parent db54d3d commit 5abc028

35 files changed

+1557
-5212
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ If you need even more flexibility, you need to dig into the Vue files and their
169169
### Basemaps
170170

171171
The file `basemaps.config.js` contains the configuration for the basemaps.
172-
You can update either just the `BASEMAPS` object or you can write a custom function `configureBasemap` that returns the desired options for [vue2-leaflet](https://vue2-leaflet.netlify.app/).
173-
[XYZ](https://vue2-leaflet.netlify.app/components/LTileLayer.html#props) and [WMS](https://vue2-leaflet.netlify.app/components/LWMSTileLayer.html#props) basemaps are supported and have different options that you can set.
172+
You can update either just the `BASEMAPS` object or you can write a custom function `configureBasemap` that returns the desired options for OpenLayers.
173+
XYZ and WMS basemaps are supported and have different options that you can set.
174174

175175
### Actions
176176

basemaps.config.js

+30-31
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,57 @@
1-
import { CRS } from 'leaflet';
21
import STAC from './src/models/stac';
32
import Utils from './src/utils';
43

54
const USGS_ATTRIBUTION = 'USGS Astrogeology';
6-
const WMS = 'LWMSTileLayer';
7-
const XYZ = 'LTileLayer';
5+
const WMS = 'TileWMS';
6+
const XYZ = 'XYZ';
87

8+
// All options (except for 'is') follow the OpenLayers options for the respective source class.
99
const BASEMAPS = {
1010
earth: {
1111
url: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
12-
name: 'OpenStreetMap',
12+
title: 'OpenStreetMap',
1313
is: XYZ,
14-
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.'
14+
attributions: '&copy; <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.'
1515
},
1616
europa: {
17-
baseUrl: 'https://planetarymaps.usgs.gov/cgi-bin/mapserv?map=/maps/jupiter/europa_simp_cyl.map',
17+
url: 'https://planetarymaps.usgs.gov/cgi-bin/mapserv?map=/maps/jupiter/europa_simp_cyl.map',
1818
is: WMS,
19-
name: 'USGS Europa',
20-
attribution: USGS_ATTRIBUTION,
21-
crs: CRS.EPSG4326,
22-
format: 'image/png',
23-
layers: 'GALILEO_VOYAGER'
19+
title: 'USGS Europa',
20+
attributions: USGS_ATTRIBUTION,
21+
projection: "EPSG:4326",
22+
params: {
23+
FORMAT: 'image/png',
24+
LAYERS: 'GALILEO_VOYAGER'
25+
}
2426
},
2527
mars: {
26-
baseUrl: 'https://planetarymaps.usgs.gov/cgi-bin/mapserv?map=/maps/mars/mars_simp_cyl.map',
28+
url: 'https://planetarymaps.usgs.gov/cgi-bin/mapserv?map=/maps/mars/mars_simp_cyl.map',
2729
is: WMS,
28-
name: 'USGS Mars',
29-
attribution: USGS_ATTRIBUTION,
30-
crs: CRS.EPSG4326,
31-
format: 'image/png',
32-
layers: 'MDIM21'
30+
title: 'USGS Mars',
31+
attributions: USGS_ATTRIBUTION,
32+
projection: "EPSG:4326",
33+
params: {
34+
FORMAT: 'image/png',
35+
LAYERS: 'MDIM21'
36+
}
3337
},
3438
moon: {
35-
baseUrl: 'https://planetarymaps.usgs.gov/cgi-bin/mapserv?map=/maps/earth/moon_simp_cyl.map',
39+
url: 'https://planetarymaps.usgs.gov/cgi-bin/mapserv?map=/maps/earth/moon_simp_cyl.map',
3640
is: WMS,
37-
name: 'USGS Moon',
38-
attribution: USGS_ATTRIBUTION,
39-
crs: CRS.EPSG4326,
40-
format: 'image/png',
41-
layers: 'LROC_WAC'
41+
title: 'USGS Moon',
42+
attributions: USGS_ATTRIBUTION,
43+
projection: "EPSG:4326",
44+
params: {
45+
FORMAT: 'image/png',
46+
LAYERS: 'LROC_WAC'
47+
}
4248
}
4349
};
4450

45-
/**
46-
* @typedef BasemapOptions
47-
* @type {Object}
48-
* @property {string} is Component: LWMSTileLayer or LTileLayer
49-
* @see https://vue2-leaflet.netlify.app/components/
50-
*/
51-
5251
/**
5352
*
5453
* @param {Object} stac The STAC object
55-
* @param {Object} map The Leaflet map object
54+
* @param {Object} map The OL map object
5655
* @param {Object} i18n Vue I18N object
5756
* @returns {Array.<BasemapOptions>}
5857
*/

config.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ module.exports = {
2525
// "pt-BR"
2626
],
2727
apiCatalogPriority: null,
28-
useTileLayerAsFallback: true,
28+
useTileLayerAsFallback: false,
2929
displayGeoTiffByDefault: false,
30-
buildTileUrlTemplate: ({href, asset}) => "https://tiles.rdnt.io/tiles/{z}/{x}/{y}@2x?url=" + encodeURIComponent(asset.href.startsWith("/vsi") ? asset.href : href),
30+
buildTileUrlTemplate: null,
3131
stacProxyUrl: null,
3232
pathPrefix: "/",
3333
historyMode: "history",
@@ -36,7 +36,6 @@ module.exports = {
3636
showKeywordsInItemCards: false,
3737
showKeywordsInCatalogCards: false,
3838
showThumbnailsAsAssets: false,
39-
geoTiffResolution: 128,
4039
redirectLegacyUrls: false,
4140
itemsPerPage: 12,
4241
defaultThumbnailSize: null,

config.schema.json

-6
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,6 @@
152152
"boolean"
153153
]
154154
},
155-
"geoTiffResolution": {
156-
"type": [
157-
"integer"
158-
],
159-
"minimum": 1
160-
},
161155
"redirectLegacyUrls": {
162156
"type": [
163157
"boolean"

0 commit comments

Comments
 (0)