Skip to content

Commit

Permalink
Added geocoreids on the raw-add-layers template page
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-NRCan committed Feb 20, 2024
1 parent c3b3dc5 commit ae5e3ee
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions packages/geoview-core/public/templates/raw-add-layers.html
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,22 @@ <h4>Add Layer Examples</h4>
<li class="source-link">https://b6ryuvakk5.execute-api.us-east-1.amazonaws.com/dev/collections/lakes</li>
</ul>
</div>
<div>
GeoCore UUID Layer
<ul>
<li>ccc75c12-5acc-4a6a-959f-ef6f621147b9</li>
</ul>
<div style="margin-bottom:20px;">
<div>
GeoCore UUID Layer
</div>
<div style="margin-top:10px; margin-left:20px;">
<input id='selectGeoCore' list="geocoreids" style="width:300px;">
<datalist id="geocoreids">
<option value="21b821cf-0f1c-40ee-8925-eab12d357668"></option>
<option value="ccc75c12-5acc-4a6a-959f-ef6f621147b9"></option>
<option value="0fca08b5-e9d0-414b-a3c4-092ff9c5e326"></option>
<option value="03ccfb5c-a06e-43e3-80fd-09d4f8f69703"></option>
<option value="ea4c0bdb-a63f-49a4-b14a-09c1560aad0b"></option>
<option value="0fe65119-e96e-4a57-8bfe-9d9245fba06b"></option>
</datalist>
<button type="button" onclick="addGeocore()">Add layer</button>
</div>
</div>
<div>
GeoPackage Layer
Expand Down Expand Up @@ -293,6 +304,14 @@ <h4 id="HUC2">2. Layer Panel with layers in config</h4>
<script src="codedoc.js"></script>

<script>
function addGeocore() {
// Precond
if (!document.getElementById('selectGeoCore').value) return;

// Add the layer on the map
cgpv.api.maps['mapWM'].layer.addGeoviewLayerByGeoCoreUUID(document.getElementById('selectGeoCore').value);
}

document.addEventListener('DOMContentLoaded', function () {
var sourceLinks = document.querySelectorAll('li.source-link');

Expand Down

0 comments on commit ae5e3ee

Please sign in to comment.