Skip to content

Commit

Permalink
Merge pull request #214 from PDOK/always-new-window
Browse files Browse the repository at this point in the history
chore(html): Always open GeoJSON/JSON-FG in new window
  • Loading branch information
rkettelerij authored Jul 12, 2024
2 parents b890589 + 06ab43a commit 579ef37
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ <h2 class="card-header h5">
<option value="http://www.opengis.net/def/crs/EPSG/0/28992">EPSG:28992</option>
</select>
als
<a href="#" onclick="gotoFeatures('json', 'selectjson'); return false;">GeoJSON</a>.
<a href="http://localhost:8180/collections/NewYork" onclick="gotoFeatures('json', 'selectjson'); return false;">GeoJSON</a>.
</li>
<li> <label for="selectjsonfg" class="visually-hidden">Ga naar Features in</label>
<select id="selectjsonfg">
<option value="https://www.opengis.net/def/crs/OGC/1.3/CRS84">WGS84</option>
<option value="http://www.opengis.net/def/crs/EPSG/0/28992">EPSG:28992</option>
</select>
als
<a href="#" onclick="gotoFeatures('jsonfg', 'selectjsonfg'); return false;">JSON-FG</a>.
<a href="http://localhost:8180/collections/NewYork" onclick="gotoFeatures('jsonfg', 'selectjsonfg'); return false;">JSON-FG</a>.
</li>
</ul>
</p>
9 changes: 2 additions & 7 deletions internal/ogc/common/geospatial/templates/collection.go.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@
} else {
url = `${baseURL}?f=${format}&crs=${crs}`;
}

if (event.ctrlKey) {
window.open(url, '_blank');
} else {
window.location.href = url;
}
window.open(url, '_blank');
}
</script>

Expand Down Expand Up @@ -163,7 +158,7 @@ <h2 class="card-header h5">
{{ end }}
</select>
{{ i18n "As" }}
<a href="#" onclick="gotoFeatures('{{ $formatKey }}', 'select{{ $formatKey }}'); return false;">{{ $formatName }}</a>.
<a href="{{ $.Config.BaseURL }}/collections/{{ $.Params.ID }}" onclick="gotoFeatures('{{ $formatKey }}', 'select{{ $formatKey }}'); return false;">{{ $formatName }}</a>.
</li>
{{ end }}
</ul>
Expand Down

0 comments on commit 579ef37

Please sign in to comment.