Skip to content

Commit 05cdb9c

Browse files
authored
Merge pull request #1798 from griidc/release/6.70.0
Release/6.70.0
2 parents 3715bc8 + 31c09cd commit 05cdb9c

File tree

14 files changed

+647
-216
lines changed

14 files changed

+647
-216
lines changed

.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,6 @@ SITEMAP_MIN_DATE='2025-01-01'
112112
WKHTMLTOPDF_PATH=/usr/local/bin/wkhtmltopdf
113113
WKHTMLTOIMAGE_PATH=/usr/local/bin/wkhtmltoimage
114114
###< knplabs/knp-snappy-bundle ###
115+
116+
###> ESRI API KEY ###
117+
ESRI_API_KEY='yourkeyhere'

assets/css/leaflet-custom.css

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
.leaflet-control-attribution {
2+
max-height: 3rem;
3+
overflow-x: auto;
4+
}
5+
6+
.leaflet-control-zoom-in span,
7+
.leaflet-control-zoom-out span {
8+
color: white;
9+
}
10+
11+
.leaflet-control-zoom-in:focus span,
12+
.leaflet-control-zoom-in:hover span,
13+
.leaflet-control-zoom-out:focus span,
14+
.leaflet-control-zoom-out:hover span {
15+
color: black;
16+
}
17+
18+
.leaflet-bar {
19+
background-color: rgba(0, 60, 136, 0.5);
20+
}
21+
22+
.leaflet-bar a:hover,
23+
.leaflet-bar a:focus {
24+
background-color: rgba(0, 60, 136, 0.5);
25+
}

assets/js/entry/data-land.js

Lines changed: 56 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,68 @@
11
import Vue from 'vue';
22
import { BootstrapVue, IconsPlugin } from 'bootstrap-vue';
3+
4+
import * as Leaflet from 'leaflet';
5+
import 'esri-leaflet';
6+
import * as EsriLeafletVector from 'esri-leaflet-vector';
7+
import '../../css/leaflet-custom.css';
8+
import Routing from '../../../vendor/friendsofsymfony/jsrouting-bundle/Resources/public/js/router.min';
39
import FileManager from '../vue/FileManager.vue';
410
import '../../css/file-manager.css';
511
import '@fortawesome/fontawesome-free/css/all.min.css';
612
import DownloadZipBtn from '../vue/components/data-land/DownloadZipBtn.vue';
713
import HelpModal from '../vue/components/data-land/HelpModal.vue';
814
import '../../scss/data-land.scss';
915

16+
const leafletMap = document.getElementById('leaflet-map');
17+
18+
if (typeof (leafletMap) !== 'undefined' && leafletMap != null) {
19+
const { datasetId } = leafletMap.dataset;
20+
const esriApiKey = process.env.ESRI_API_KEY;
21+
22+
const GRIIDCStyle = {
23+
color: 'orange',
24+
weight: 4,
25+
opacity: 1,
26+
fillOpacity: 0.15,
27+
};
28+
29+
const map = Leaflet.map('leaflet-map', {
30+
preferCanvas: true,
31+
minZoom: 3,
32+
maxZoom: 14,
33+
attributionControl: true,
34+
worldCopyJump: true,
35+
});
36+
37+
const basemapEnum = 'ArcGIS:Imagery';
38+
EsriLeafletVector.vectorBasemapLayer(basemapEnum, {
39+
apiKey: esriApiKey,
40+
}).addTo(map);
41+
42+
Leaflet.featureGroup().addTo(map);
43+
44+
const url = `${Routing.generate('pelagos_app_ui_dataland_get_json')}/${datasetId}`;
45+
fetch(url).then((response) => response.json()).then((response) => {
46+
const geojsonMarkerOptions = {
47+
radius: 12,
48+
fill: false,
49+
weight: 4,
50+
opacity: 1,
51+
};
52+
const geojsonLayer = Leaflet.geoJson(response, {
53+
pointToLayer(feature, latlng) {
54+
return Leaflet.circleMarker(latlng, geojsonMarkerOptions);
55+
},
56+
style: GRIIDCStyle,
57+
onEachFeature(feature, layer) {
58+
layer.bindTooltip(feature.properties.name.toString(), { permanent: false, className: 'label' });
59+
},
60+
}).addTo(map);
61+
const bounds = geojsonLayer.getBounds();
62+
map.fitBounds(bounds, { padding: [20, 20] });
63+
});
64+
}
65+
1066
// Mount File Manager vue component
1167
const fileManagerElement = document.getElementById('file-manager-app');
1268
if (fileManagerElement) {
@@ -87,25 +143,6 @@ if (helpBtnElement) {
87143
});
88144
}
89145

90-
// eslint-disable-next-line no-undef
91-
const dlmap = new GeoViz();
92-
93-
dlmap.initMap('dlolmap', {
94-
onlyOneFeature: false, allowModify: false, allowDelete: false, staticMap: false, labelAttr: 'udi',
95-
});
96-
97-
// eslint-disable-next-line no-undef
98-
const geovizMap = $('#dlolmap');
99-
100-
if (geovizMap.attr('description') !== '' && geovizMap.attr('wkt') === '') {
101-
const imagePath = geovizMap.attr('labimage');
102-
dlmap.addImage(imagePath, 0.4);
103-
dlmap.makeStatic();
104-
} else if (geovizMap.attr('wkt')) {
105-
dlmap.addFeatureFromWKT(geovizMap.attr('wkt'), { udi: geovizMap.attr('udi') });
106-
dlmap.gotoAllFeatures();
107-
}
108-
109146
const metadataDownloadBtn = document.getElementById('metadata-download');
110147
if (metadataDownloadBtn) {
111148
metadataDownloadBtn.addEventListener('click', () => {

0 commit comments

Comments
 (0)