Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose OGC API - Feature (WFS3) service [g3w-admin PR#788] #607

Merged
merged 1 commit into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/app/core/layers/imagelayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,14 @@ proto.getCatalogWfsUrl = function(){
return `${this.getWfsUrl()}?service=WFS&version=1.1.0&request=GetCapabilities`;
};

/**
* Get WFS 3 url (used by Catalog Layer Menu)
* @since 3.10.0
* @return { String } url
*/
proto.getCatalogWfs3Url = function(){
return `${this.getWfsUrl()}wfs3/`;
};

proto.getWfsUrl = function() {
const { wms_url } = ProjectsRegistry.getCurrentProject().getMetadata();
Expand Down
48 changes: 47 additions & 1 deletion src/components/CatalogLayerContextMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,37 @@
</div>
</li>

<!-- Click to Copy WFS 3 URL @since 3.10.0 -->
<li
v-if="canShowWfsUrl(layerMenu.layer.id)"
>
<div
@click.prevent.stop="copyUrl({evt: $event, layerId:layerMenu.layer.id, type:'Wfs3'})"
style="display: flex; max-width:300px; align-items: center;"
>
<span
class="menu-icon skin-color-dark"
:class="g3wtemplate.getFontClass('map')">
</span>
<div style="display: inline-flex; justify-content: space-between; width: 100%; align-items: baseline">
<span
class="item-text catalog-menu-wms skin-tooltip-top"
data-toggle="tooltip"
data-container="body"
v-t-tooltip="'sdk.catalog.menu.wms.copy'"
>WFS 3 URL</span>
<span
class="bold catalog-menu-wms wms-url-tooltip skin-tooltip-top skin-color-dark"
:class="g3wtemplate.getFontClass('eye')"
data-placement="top"
data-toggle="tooltip"
data-container="body"
:title="getWfs3Url(layerMenu.layer.id)"
></span>
</div>
</div>
</li>

<!-- Click to open G3W-ADMIN's project layers page -->
<li v-if="layers_url">
<div>
Expand Down Expand Up @@ -711,7 +742,22 @@
return CatalogLayersStoresRegistry.getLayerById(layerId).getCatalogWfsUrl();
},

copyUrl({evt, layerId, type}={}) {
/**
* @since 3.10.0
* @param layerId
* @return { String } wfs3 url
*/
getWfs3Url(layerId) {
return CatalogLayersStoresRegistry.getLayerById(layerId).getCatalogWfs3Url();
},

/**
*
* @param evt
* @param layerId
* @param { String } type Wms, Wfs, Wfs3
*/
copyUrl({ evt, layerId, type } = {}) {
const url = this[`get${type}Url`](layerId);
let ancorEement = document.createElement('a');
ancorEement.href = url;
Expand Down
Loading