Skip to content

Commit

Permalink
Merge branch 'dev' into issue_609
Browse files Browse the repository at this point in the history
  • Loading branch information
volterra79 committed Apr 12, 2024
2 parents 4d8941d + e8587d4 commit fb7be8f
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 1 deletion.
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

0 comments on commit fb7be8f

Please sign in to comment.