forked from CollectionBuilder/collectionbuilder-csv
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add geodata layout * add testdata * wip * add swiss map projection * delete 'format' from browse page * add testdata in new datamodel * wip * wip * wip * wip * wip * wip * add testdata * improve external links * undo changes in file * add links in description * adopt infoclio citation style * adopt new link notation * delete testdata * rename display_names and fix label * fix download-button * fix external_link
- Loading branch information
Showing
16 changed files
with
6,219 additions
and
40 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 |
---|---|---|
|
@@ -4,3 +4,4 @@ subject,Themen,true,, | |
era,Epoche,true,, | ||
creator,,,true, | ||
publisher,,,true, | ||
language,,,true, |
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 |
---|---|---|
@@ -1,20 +1,20 @@ | ||
field,display_name,browse_link,external_link,dc_map,schema_map | ||
objectid,Identifikator,,,DCTERMS.identifier,identifier | ||
title,Titel,,,DCTERMS.title,headline | ||
creator,Ersteller*in,,,DCTERMS.creator,creator | ||
date,Datum,,,DCTERMS.date,dateCreated | ||
era,Epoche,true,,DCTERMS.temporal, | ||
description,Beschreibung,,,DCTERMS.description,description | ||
subject,Thema,true,,DCTERMS.subject,keywords | ||
publisher,Rechteinhaber*in,true,,DCTERMS.publisher,publisher | ||
source,Quelle,,,DCTERMS.source, | ||
relation,Link,,true,DCTERMS.relation, | ||
hasVersion,IIIF Manifest,,true,DCTERMS.hasVersion,version | ||
type,Typ,,,DCTERMS.type, | ||
era,Epoche,true,,DCTERMS.temporal, | ||
isPartOf,Gehört zu,,true,DCTERMS.isPartOf,isPartOf | ||
creator,Ersteller*in,,true,DCTERMS.creator,creator | ||
publisher,Verantwortliche Gedächtnisinstitution,,true,DCTERMS.publisher,publisher | ||
date,Datum,,,DCTERMS.date,dateCreated | ||
source,Quelle,,true,DCTERMS.source, | ||
type,Typ,,true,DCTERMS.type, | ||
format,Format,,,DCTERMS.format,encodingFormat | ||
extent,Auflösung,,,DCTERMS.extent, | ||
language,Sprache,true,,DCTERMS.language,inLanguage | ||
rights,Rechte,,,DCTERMS.rights,usageInfo | ||
license,Lizenz,,true,DCTERMS.license,license | ||
isReferencedBy,Abbildung,,,DCTERMS.isReferencedBy, | ||
isPartOf,Band,,,DCTERMS.isPartOf,isPartOf | ||
relation,Verwandte Ressourcen,,true,DCTERMS.relation,relation | ||
|
||
|
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,167 @@ | ||
{% comment %} | ||
|
||
Mini Leaflet Map item feature. | ||
This include adds a small leaflet map. | ||
|
||
E.G> --> {% include feature/geodata_map.html %} | ||
|
||
Options: | ||
- "latitude" = center of map, required if not using objectid | ||
- "longitude" = center of map, required if not using objectid | ||
- "height" = height of the mini map in px (default 400px) | ||
- "map-zoom" = provide a zoom level, default 10 | ||
- "map-link" = true/false, add a button link to the collection's default full map page (default false) | ||
- "basemap" = set basemap option, Esri_WorldStreetMap, Esri_NatGeoWorldMap, Esri_WorldImagery. default Esri_WorldImagery. | ||
|
||
{% endcomment %} | ||
{% capture map_id %}mini-map_{{ include.latitude | slugify }}{% endcapture %} | ||
{% assign map-item = site.data[site.metadata] | where: "objectid", include.objectid | first %} | ||
{% assign geojson = page.object_location %} | ||
<style> | ||
#{{ map_id }} { height: {{ include.height | default: '500px' }}; z-index: 98; } | ||
</style> | ||
<div id="{{ map_id }}" class="text-start"></div> | ||
{% if include.map-link == true %} | ||
<a href="{{ '/map.html' | relative_url }}?location={{ map-item.latitude | default: include.latitude }},{{ map-item.longitude | default: include.longitude }}{%if include.objectid %}&marker={{ include.objectid }}{% endif %}" class="btn btn-outline-primary my-3">View on Full Map</a>{% endif %} | ||
<!-- load leaflet dependencies --> | ||
<link rel="stylesheet" href="{{ '/assets/lib/leaflet/leaflet.css' | relative_url }}"> | ||
<link rel="stylesheet" href="{{ '/assets/lib/leaflet/leaflet.fullscreen.css' | relative_url }}"> | ||
<script src="{{ '/assets/lib/leaflet/leaflet.js' | relative_url }}"></script> | ||
<script src="{{ '/assets/lib/leaflet/Leaflet.fullscreen.min.js' | relative_url }}"></script> | ||
<script src="{{ '/assets/lib/proj4leaflet/proj4.js' | relative_url }}"></script> | ||
<script src="{{ '/assets/lib/proj4leaflet/proj4leaflet.js' | relative_url }}"></script> | ||
|
||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/Leaflet.TileLayer.Swiss.umd.js" | ||
crossorigin integrity="sha384-M4p8VfZ8RG6qNiPYA3vOCApQXAlLtnJXVPdydMYPAsvvIDsWp2dqqzF2OEeWWNhy"> | ||
</script> | ||
|
||
<script> | ||
var url = '{{ geojson | default: 'null' }}'; | ||
var geoJsonData; | ||
|
||
fetch(url) | ||
.then(response => response.json()) | ||
.then(data => { | ||
geoJsonData = data; | ||
const crsValue = geoJsonData.crs.properties.name; | ||
|
||
/* initial start point */ | ||
var mapCenter = [{{ map-item.latitude | default: 0 }}, {{ map-item.longitude | default: 0 }}]; | ||
var mapZoom = {{ include.map-zoom | default: 10 }}; | ||
|
||
if (crsValue === 'urn:ogc:def:crs:EPSG::2056') { | ||
proj4.defs(crsValue, "+proj=somerc +lat_0=46.9524055555556 +lon_0=7.43958333333333 +k_0=1 +x_0=2600000 +y_0=1200000 +ellps=bessel +towgs84=674.374,15.056,405.346,0,0,0,0 +units=m +no_defs"); | ||
var map = L.map('{{ map_id }}', { | ||
// Use LV95 (EPSG:2056) projection | ||
crs: L.CRS.EPSG2056, | ||
}).setView(mapCenter, mapZoom); | ||
|
||
var mapLayer = L.tileLayer.swiss({ | ||
layer: 'ch.swisstopo.pixelkarte-grau', | ||
maxNativeZoom: 28 | ||
}); | ||
var satelliteLayer = L.tileLayer.swiss({ | ||
layer: 'ch.swisstopo.swissimage', | ||
maxNativeZoom: 28 | ||
}); | ||
var baseMaps = { | ||
'Karte': mapLayer, | ||
'Satellit (Swissimage)': satelliteLayer | ||
}; | ||
var overlayMaps = { | ||
'Höhenmodell': L.tileLayer.swiss({ | ||
format: 'png', | ||
layer: 'ch.swisstopo.digitales-hoehenmodell_25_reliefschattierung', | ||
maxNativeZoom: 28, | ||
opacity: 1, | ||
timestamp: 'current' | ||
}), | ||
'Dufourkarte': L.tileLayer.swiss({ | ||
format: 'png', | ||
layer: 'ch.swisstopo.hiks-dufour', | ||
maxNativeZoom: 28, | ||
opacity: 1, | ||
timestamp: 'current' | ||
}), | ||
'Siegfriedkarte (1870-1926)': L.tileLayer.swiss({ | ||
format: 'png', | ||
layer: 'ch.swisstopo.hiks-siegfried', | ||
maxNativeZoom: 28, | ||
opacity: 1, | ||
timestamp: 'current' | ||
}), | ||
'Kantonsgrenzen': L.tileLayer.swiss({ | ||
format: 'png', | ||
layer: 'ch.swisstopo.swissboundaries3d-kanton-flaeche.fill', | ||
maxNativeZoom: 28, | ||
opacity: 0.7, | ||
timestamp: 'current' | ||
}) | ||
}; | ||
map.fitSwitzerland(); | ||
|
||
L.control.layers(baseMaps, overlayMaps, { collapsed: true }).addTo(map); | ||
/* load base map */ | ||
{{ include.basemap | default: 'mapLayer' }}.addTo(map); | ||
|
||
/* add fullscreen control */ | ||
map.addControl(new L.Control.Fullscreen()); | ||
|
||
|
||
/* add geojson layer */ | ||
const layer = L.Proj.geoJson(geoJsonData, { | ||
onEachFeature: function (f, l) { | ||
l.bindPopup('<pre>'+JSON.stringify(f.properties,null,' ').replace(/[\{\}"]/g,'')+'</pre>'); | ||
} | ||
}).addTo(map); | ||
} | ||
else { | ||
var map = L.map('{{ map_id }}').setView(mapCenter, mapZoom); | ||
|
||
/* add map layer options */ | ||
var Esri_WorldTopoMap = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}', { | ||
attribution: 'Tiles © Esri — Esri, DeLorme, NAVTEQ, TomTom, Intermap, iPC, USGS, FAO, NPS, NRCAN, GeoBase, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), and the GIS User Community' | ||
}); | ||
var Esri_WorldGrayCanvas = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}', { | ||
attribution: 'Tiles © Esri — Esri, DeLorme, NAVTEQ', | ||
maxZoom: 16 | ||
}); | ||
var Esri_WorldShadedRelief = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Shaded_Relief/MapServer/tile/{z}/{y}/{x}', { | ||
attribution: 'Tiles © Esri — Source: Esri', | ||
maxZoom: 13 | ||
}); | ||
var Esri_WorldImagery = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', { | ||
attribution: 'Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community' | ||
}); | ||
/* add base map switcher */ | ||
var baseMaps = { | ||
"Esri World TopoMap": Esri_WorldTopoMap, | ||
"Esri World Gray Canvas": Esri_WorldGrayCanvas, | ||
"Esri World Shaded Relief": Esri_WorldShadedRelief, | ||
"Esri Imagery": Esri_WorldImagery | ||
}; | ||
L.control.layers(baseMaps).addTo(map); | ||
/* load base map */ | ||
{{ include.basemap | default: 'Esri_WorldImagery' }}.addTo(map); | ||
|
||
/* add fullscreen control */ | ||
map.addControl(new L.Control.Fullscreen()); | ||
|
||
/* add geojson layer */ | ||
const layer = L.geoJSON(geoJsonData, { | ||
onEachFeature: function (f, l) { | ||
l.bindPopup('<pre>'+JSON.stringify(f.properties,null,' ').replace(/[\{\}"]/g,'')+'</pre>'); | ||
} | ||
}).addTo(map); | ||
/* Fit map to GeoJSON layer bounds */ | ||
map.fitBounds(layer.getBounds()); | ||
} | ||
|
||
}) | ||
.catch(error => { | ||
console.error('Error fetching GeoJSON data:', error); | ||
}); | ||
|
||
|
||
|
||
</script> |
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
Oops, something went wrong.