|
1 |
| -import { CRS } from 'leaflet'; |
2 | 1 | import STAC from './src/models/stac';
|
3 | 2 | import Utils from './src/utils';
|
4 | 3 |
|
5 | 4 | const USGS_ATTRIBUTION = 'USGS Astrogeology';
|
6 |
| -const WMS = 'LWMSTileLayer'; |
7 |
| -const XYZ = 'LTileLayer'; |
| 5 | +const WMS = 'TileWMS'; |
| 6 | +const XYZ = 'XYZ'; |
8 | 7 |
|
| 8 | +// All options (except for 'is') follow the OpenLayers options for the respective source class. |
9 | 9 | const BASEMAPS = {
|
10 | 10 | earth: {
|
11 | 11 | url: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
|
12 |
| - name: 'OpenStreetMap', |
| 12 | + title: 'OpenStreetMap', |
13 | 13 | is: XYZ,
|
14 |
| - attribution: '© <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.' |
| 14 | + attributions: '© <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.' |
15 | 15 | },
|
16 | 16 | 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', |
18 | 18 | 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 | + } |
24 | 26 | },
|
25 | 27 | 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', |
27 | 29 | 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 | + } |
33 | 37 | },
|
34 | 38 | 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', |
36 | 40 | 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 | + } |
42 | 48 | }
|
43 | 49 | };
|
44 | 50 |
|
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 |
| - |
52 | 51 | /**
|
53 | 52 | *
|
54 | 53 | * @param {Object} stac The STAC object
|
55 |
| - * @param {Object} map The Leaflet map object |
| 54 | + * @param {Object} map The OL map object |
56 | 55 | * @param {Object} i18n Vue I18N object
|
57 | 56 | * @returns {Array.<BasemapOptions>}
|
58 | 57 | */
|
|
0 commit comments