-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstac-browser.patch
94 lines (92 loc) · 3.08 KB
/
stac-browser.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
diff --git a/basemaps.config.js b/basemaps.config.js
index 230e7988..e5fa6d1c 100644
--- a/basemaps.config.js
+++ b/basemaps.config.js
@@ -70,5 +70,10 @@ export default function configureBasemap(stac, map, i18n) {
}
}
- return targets.map(target => BASEMAPS[target.toLowerCase()]);
-};
\ No newline at end of file
+ let myBasemaps = BASEMAPS;
+ if (window.STAC_BROWSER_CONFIG !== undefined && window.STAC_BROWSER_CONFIG.basemaps !== undefined) {
+ myBasemaps = window.STAC_BROWSER_CONFIG.basemaps
+ }
+
+ return targets.map(target => myBasemaps[target.toLowerCase()]);
+};
diff --git a/config.js b/config.js
index 01110537..13c66b61 100644
--- a/config.js
+++ b/config.js
@@ -26,7 +26,7 @@ module.exports = {
buildTileUrlTemplate: ({href, asset}) => "https://tiles.rdnt.io/tiles/{z}/{x}/{y}@2x?url=" + encodeURIComponent(asset.href.startsWith("/vsi") ? asset.href : href),
stacProxyUrl: null,
pathPrefix: "/",
- historyMode: "history",
+ historyMode: "hash",
cardViewMode: "cards",
cardViewSort: "asc",
showThumbnailsAsAssets: false,
@@ -41,4 +41,4 @@ module.exports = {
requestQueryParameters: {},
preprocessSTAC: null,
authConfig: null
-};
\ No newline at end of file
+};
diff --git a/public/index.html b/public/index.html
index cc206ac3..7e6a1e64 100644
--- a/public/index.html
+++ b/public/index.html
@@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta id="meta-description" name="description" content="">
- <!-- <script defer="defer" src="./config.js"></script> -->
+ <script defer="defer" src="./config.js"></script>
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
diff --git a/src/components/Map.vue b/src/components/Map.vue
index 4338691c..ea5f18ef 100644
--- a/src/components/Map.vue
+++ b/src/components/Map.vue
@@ -41,6 +41,7 @@ import STAC from '../models/stac';
import { object as formatObject, string as formatString } from '@radiantearth/stac-fields/datatypes';
import { BPopover } from 'bootstrap-vue';
import getBasemaps from '../../basemaps.config';
+import { CRS } from 'leaflet';
// Fix missing icons: https://vue2-leaflet.netlify.app/quickstart/#marker-icons-are-missing
import { Icon } from 'leaflet';
@@ -89,6 +90,12 @@ export default {
}
},
data() {
+ let mapOptions = {
+ zoomControl: false
+ }
+ if (window.STAC_BROWSER_CONFIG !== undefined && window.STAC_BROWSER_CONFIG.crs === 'EPSG:4326') {
+ mapOptions.crs = CRS.EPSG4326;
+ }
return {
secondaryColor: '#FF8833',
secondaryWeight: 2,
@@ -98,9 +105,7 @@ export default {
stacLayer: null,
geojson: null,
itemPreviewsLayer: null,
- mapOptions: {
- zoomControl: false
- },
+ mapOptions: mapOptions,
dblClickState: null,
selectedItem: null,
ix: 1
@@ -452,4 +457,4 @@ export default {
<style lang="scss">
@import '~leaflet/dist/leaflet.css';
@import '../theme/leaflet-areaselect.scss';
-</style>
\ No newline at end of file
+</style>