diff --git a/lizmap/modules/lizmap/lib/Project/Project.php b/lizmap/modules/lizmap/lib/Project/Project.php index b6e6b019a7..ca64d575d7 100644 --- a/lizmap/modules/lizmap/lib/Project/Project.php +++ b/lizmap/modules/lizmap/lib/Project/Project.php @@ -558,6 +558,25 @@ public function getWMTSGetCapabilitiesUrl() ); } + /** + * Get the WFS GetCapabilities Url. + * + * @return string + */ + public function getWFSGetCapabilitiesUrl() + { + return $this->appContext->getFullUrl( + 'lizmap~service:index', + array( + 'repository' => $this->repository->getKey(), + 'project' => $this->key, + 'SERVICE' => 'WFS', + 'VERSION' => '1.0.0', + 'REQUEST' => 'GetCapabilities', + ) + ); + } + public function getFileTime() { return $this->cacheHandler->getFileTime(); @@ -689,6 +708,9 @@ public function getData($key) case 'wmtsGetCapabilitiesUrl': return $this->getWMTSGetCapabilitiesUrl(); + + case 'wfsGetCapabilitiesUrl': + return $this->getWFSGetCapabilitiesUrl(); } return $this->qgis->getData($key); @@ -2233,6 +2255,7 @@ public function getDefaultDockable() if ($wmsGetCapabilitiesUrl) { $wmsGetCapabilitiesUrl = $this->getWMSGetCapabilitiesUrl(); $wmtsGetCapabilitiesUrl = $this->getWMTSGetCapabilitiesUrl(); + $wfsGetCapabilitiesUrl = $this->getWFSGetCapabilitiesUrl(); } $metadataTpl->assign(array_merge(array( 'repositoryLabel' => $this->repository->getLabel(), @@ -2240,6 +2263,7 @@ public function getDefaultDockable() 'project' => $this->getKey(), 'wmsGetCapabilitiesUrl' => $wmsGetCapabilitiesUrl, 'wmtsGetCapabilitiesUrl' => $wmtsGetCapabilitiesUrl, + 'wfsGetCapabilitiesUrl' => $wfsGetCapabilitiesUrl, ), $wmsInfo)); $dockable[] = new \lizmapMapDockItem( 'metadata', diff --git a/lizmap/modules/lizmap/lib/Project/ProjectMainData.php b/lizmap/modules/lizmap/lib/Project/ProjectMainData.php index 7151420dee..16901d48e3 100644 --- a/lizmap/modules/lizmap/lib/Project/ProjectMainData.php +++ b/lizmap/modules/lizmap/lib/Project/ProjectMainData.php @@ -96,6 +96,16 @@ public function __construct($repository, $id, $file, $requiredTargetLwcVersion, 'REQUEST' => 'GetCapabilities', ) ); + $this->data['wfsGetCapabilitiesUrl'] = $appContext->getFullUrl( + 'lizmap~service:index', + array( + 'repository' => $repository, + 'project' => $id, + 'SERVICE' => 'WFS', + 'VERSION' => '1.0.0', + 'REQUEST' => 'GetCapabilities', + ) + ); // Check right on repository if ($this->data['acl'] && !$appContext->aclCheck('lizmap.repositories.view', $repository)) { @@ -225,6 +235,16 @@ public function getWMTSGetCapabilitiesUrl() return $this->data['wmtsGetCapabilitiesUrl']; } + /** + * The url of WFS GetCapabilities. + * + * @return string + */ + public function getWFSGetCapabilitiesUrl() + { + return $this->data['wfsGetCapabilitiesUrl']; + } + /** * The main data. * diff --git a/lizmap/modules/lizmap/lib/Project/ProjectMetadata.php b/lizmap/modules/lizmap/lib/Project/ProjectMetadata.php index 9a3fa7ab3f..5224b8398d 100644 --- a/lizmap/modules/lizmap/lib/Project/ProjectMetadata.php +++ b/lizmap/modules/lizmap/lib/Project/ProjectMetadata.php @@ -38,6 +38,7 @@ public function __construct(Project $project) 'bbox' => $project->getBbox(), 'wmsGetCapabilitiesUrl' => $project->getWMSGetCapabilitiesUrl(), 'wmtsGetCapabilitiesUrl' => $project->getWMTSGetCapabilitiesUrl(), + 'wfsGetCapabilitiesUrl' => $project->getWFSGetCapabilitiesUrl(), 'map' => $project->getRelativeQgisPath(), 'acl' => $project->checkAcl(), 'qgisProjectVersion' => $project->getQgisProjectVersion(), @@ -182,6 +183,17 @@ public function getWMTSGetCapabilitiesUrl() { return $this->data['wmtsGetCapabilitiesUrl']; } + } + + /** + * The url of WFS GetCapabilities. + * + * @return string + */ + public function getWFSGetCapabilitiesUrl() + { + return $this->data['wfsGetCapabilitiesUrl']; + } /** * The QGIS desktop project version. diff --git a/lizmap/modules/view/classes/lizmapMainViewItem.class.php b/lizmap/modules/view/classes/lizmapMainViewItem.class.php index fc909783d9..2378f204e4 100644 --- a/lizmap/modules/view/classes/lizmapMainViewItem.class.php +++ b/lizmap/modules/view/classes/lizmapMainViewItem.class.php @@ -24,10 +24,15 @@ class lizmapMainViewItem public $type = ''; public $wmsGetCapabilitiesUrl = ''; public $wmtsGetCapabilitiesUrl = ''; + public $wfsGetCapabilitiesUrl = ''; public $childItems = array(); - public function __construct($id, $title, $abstract = '', $keywordList = '', $proj = '', $bbox = '', $url = '', $img = '', $order = 0, $parentId = '', $type = 'rep', $wmsGetCapabilitiesUrl = '', $wmtsGetCapabilitiesUrl = '') + public function __construct( + $id, $title, $abstract = '', $keywordList = '', $proj = '', $bbox = '', $url = '', + $img = '', $order = 0, $parentId = '', $type = 'rep', + $wmsGetCapabilitiesUrl = '', $wmtsGetCapabilitiesUrl = '', $wfsGetCapabilitiesUrl = '' + ) { $this->id = $id; $this->parentId = $parentId; @@ -42,6 +47,7 @@ public function __construct($id, $title, $abstract = '', $keywordList = '', $pro $this->type = $type; $this->wmsGetCapabilitiesUrl = $wmsGetCapabilitiesUrl; $this->wmtsGetCapabilitiesUrl = $wmtsGetCapabilitiesUrl; + $this->wfsGetCapabilitiesUrl = $wfsGetCapabilitiesUrl; } public function copyFrom($item) diff --git a/lizmap/modules/view/templates/map_metadata.tpl b/lizmap/modules/view/templates/map_metadata.tpl index 7e028a0bd3..a5deb49973 100644 --- a/lizmap/modules/view/templates/map_metadata.tpl +++ b/lizmap/modules/view/templates/map_metadata.tpl @@ -54,12 +54,17 @@
{$WMSExtent}

+ {ifacl2 'lizmap.tools.displayGetCapabilitiesLinks'} {if $wmsGetCapabilitiesUrl}
{@view~map.metadata.properties.wmsGetCapabilitiesUrl@}
WMS Url
WMTS Url
+ {ifacl2 'lizmap.tools.layer.export'} +
WFS Url
+ {/ifacl2}
{/if} + {/ifacl2}

diff --git a/lizmap/modules/view/templates/view.tpl b/lizmap/modules/view/templates/view.tpl index d21856b5f5..076d878755 100644 --- a/lizmap/modules/view/templates/view.tpl +++ b/lizmap/modules/view/templates/view.tpl @@ -95,6 +95,9 @@
WMS Url
WMTS Url
+ {ifacl2 'lizmap.tools.layer.export'} +
WFS Url
+ {/ifacl2}
{/if} diff --git a/lizmap/modules/view/zones/main_view.zone.php b/lizmap/modules/view/zones/main_view.zone.php index 9f5864c976..dda1a43a04 100644 --- a/lizmap/modules/view/zones/main_view.zone.php +++ b/lizmap/modules/view/zones/main_view.zone.php @@ -82,6 +82,7 @@ protected function _prepareTpl() if ($wmsGetCapabilitiesUrl) { $wmsGetCapabilitiesUrl = $meta->getWMSGetCapabilitiesUrl(); $wmtsGetCapabilitiesUrl = $meta->getWMTSGetCapabilitiesUrl(); + $wfsGetCapabilitiesUrl = $meta->getWFSGetCapabilitiesUrl(); } // Allowed image types lower or upper case @@ -114,7 +115,8 @@ protected function _prepareTpl() $r, 'map', $wmsGetCapabilitiesUrl, - $wmtsGetCapabilitiesUrl + $wmtsGetCapabilitiesUrl, + $wfsGetCapabilitiesUrl ); } }