-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add map element & update landing page
- Loading branch information
Showing
3 changed files
with
83 additions
and
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
mapLink = | ||
'<a href="http://www.esri.com/">Esri</a>'; | ||
|
||
wholink = | ||
'i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community'; | ||
|
||
var esri = L.tileLayer( | ||
'http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', { | ||
attribution: '© '+mapLink+', '+wholink, | ||
maxZoom: 18, | ||
}); | ||
|
||
var positron = L.tileLayer( | ||
"https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png", { | ||
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, © <a href="http://cartodb.com/attributions">CartoDB</a>', | ||
}); | ||
|
||
var wmsLayer = L.tileLayer.wms('https://map.bgs.ac.uk/arcgis/services/AGS/AGS_Export/MapServer/WMSServer?', { | ||
layers: 'Boreholes', | ||
format: 'image/png', | ||
transparent: true, | ||
attribution: "AGS Data from British Geological Survey", | ||
}); | ||
|
||
var agsboreholes = L.featureGroup | ||
.ogcApi("https://ogcapi.bgs.ac.uk/", { | ||
collection: "agsboreholeindex", | ||
onEachFeature: function (feat, layer) { | ||
var properties = feat.properties; | ||
var popupContent = "<b>AGS Borehole Information</b><br><hr>" + | ||
"<b>BGS LOCA ID: </b>" + properties.bgs_loca_id + "<br>" + | ||
"<b>Depth (m): </b>" + properties.loca_fdep + "<br>" + | ||
"<b>Project Name: </b>" + properties.proj_name + "<br>" + | ||
"<b>Project Engineer: </b>" + properties.proj_eng + "<br>" + | ||
"<b>Project Contractor: </b>" + properties.proj_cont + "<br>" + | ||
"<b>Original LOCA ID: </b>" + properties.loca_id + "<br>" + | ||
"<b>AGS Graphical Log: </b>" + "<a href=" + "https://agsapi.bgs.ac.uk/ags_log/?bgs_loca_id=" + properties.bgs_loca_id + " target=" + "_blank" + ">View</a>" + "<br>" + | ||
"<b>AGS Submission Record (raw data): </b>" + "<a href=" + properties.dad_item_url + " target=" + "_blank" + ">View</a>" + "<br>"; | ||
layer.bindPopup(popupContent); | ||
}, | ||
}); | ||
|
||
var map = L.map("map", { | ||
center: [54.093409, -2.89479], | ||
zoom: 6, | ||
layers: [esri, positron, wmsLayer, agsboreholes] | ||
}); | ||
|
||
agsboreholes.once("ready", function (ev) { | ||
map.fitBounds(agsboreholes.getBounds()); | ||
}); |
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 |
---|---|---|
|
@@ -19,24 +19,14 @@ | |
<link rel="stylesheet" href="/static/css/htmlView.css"> | ||
<link rel="stylesheet" href="https://npmcdn.com/[email protected]/dist/leaflet.css" /> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet.draw/1.0.4/leaflet.draw.css"/> | ||
<link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css" crossorigin=""/> | ||
|
||
<script type="text/javascript" src="//resources.bgs.ac.uk/webapps/resources/js/jquery.min.js"></script> | ||
<script type="text/javascript" src="//resources.bgs.ac.uk/webapps/resources/js/main.js"></script> | ||
<script type="text/javascript" src="/static/js/htmlView.js"></script> | ||
<script type="text/javascript" src="https://unpkg.com/leaflet/dist/leaflet-src.js" crossorigin=""></script> | ||
<script src="https://unpkg.com/[email protected]/dist/leaflet.js" integrity="sha256-WBkoXOwTeyKclOHuWtc+i2uENFpDZ9YPdf5Hf+D7ewM=" crossorigin=""></script> | ||
|
||
<link | ||
rel="stylesheet" | ||
href="https://unpkg.com/leaflet/dist/leaflet.css" | ||
crossorigin="" | ||
/> | ||
<script | ||
src="https://unpkg.com/leaflet/dist/leaflet-src.js" | ||
crossorigin="" | ||
></script> | ||
|
||
<script src="/static/js/Leaflet.FeatureGroup.OGCAPI.js"></script> | ||
|
||
|
||
<!-- Google Tag Manager --> | ||
<!-- Global site tag (gtag.js) - Google Analytics --> | ||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-J768KTXMCP"></script> | ||
|
@@ -478,30 +468,8 @@ <h3>Policies & legal</h3> | |
}); | ||
} | ||
</script> | ||
<script> | ||
var map = L.map("map", {}); | ||
|
||
var positron = L.tileLayer( | ||
"https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png", | ||
{ | ||
attribution: | ||
'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, © <a href="http://cartodb.com/attributions">CartoDB</a>', | ||
} | ||
).addTo(map); | ||
|
||
var trees = L.featureGroup | ||
.ogcApi("https://ogcapi.bgs.ac.uk/", { | ||
collection: "agsboreholeindex", | ||
onEachFeature: function (feat, layer) { | ||
layer.bindPopup(Object.entries(feat.properties).join("<br>")); | ||
}, | ||
}) | ||
.addTo(map); | ||
|
||
trees.once("ready", function (ev) { | ||
map.fitBounds(trees.getBounds()); | ||
}); | ||
</script> | ||
<script src="/static/js/Leaflet.FeatureGroup.OGCAPI.js"></script> | ||
<script src="/static/js/map.js"></script> | ||
|
||
</body> | ||
</html> |
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