Skip to content
Browse files

Merge pull request #42276 from elpaso/bugfix-gh42275-wfs3-string-fids…


Fix wfs3 template with string fids
  • Loading branch information
elpaso authored and nyalldawson committed Mar 17, 2021
1 parent a9455d4 commit b7b73a0b0e0bf538ddbd153de0eac95a1d71e0e6
@@ -311,7 +311,7 @@ void QgsServerOgcApiHandler::htmlDump( const json &data, const QgsServerApiConte
fName.chop( 1 );
fName += '/' + QString::number( 0 )->get<QgsFeatureId>( ) );
fName += '/' + QString::fromStdString( 0 )->get<std::string>( ) );
if ( !suffix.isEmpty() )
fName += '.' + suffix;
@@ -525,6 +525,15 @@ def test_wfs3_collection_items(self):
self.compareApi(request, project,

def test_wfs3_collection_items_html(self):
"""Test WFS3 API items"""
project = QgsProject()'qgis_server') + '/test_project_api.qgs')
request = QgsBufferServerRequest(
self.compareApi(request, project,

def test_wfs3_collection_items_crs(self):
"""Test WFS3 API items with CRS"""
project = QgsProject()
@@ -0,0 +1,175 @@
<!-- template for the WFS3 API getFeatures page -->
<!doctype html>
<html lang="en">
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

<!-- Bootstrap CSS -->
<link rel="stylesheet" href="" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" href=""
<link rel="stylesheet" href="/wfs3/static/style.css" />
<script src=""
<link rel="stylesheet" href="/wfs3/static/jsonFormatter/jsonFormatter.min.css" crossorigin="anonymous">
<script src="/wfs3/static/jsonFormatter/jsonFormatter.min.js" crossorigin="anonymous"></script>

<!-- template for the WFS3 API links list, to be included in HEAD -->

<link rel="alternate" href="" title="Retrieve the features of the collection as GEOJSON" type="application/geo+json">

<link rel="self" href="" title="Retrieve the features of the collection as HTML" type="text/html">

<title>Features in layer A test vector layer èé</title>
<nav class="navbar navbar-light bg-light navbar-expand-sm">
<div class="container">
<div id="navbar" class="navbar-collapse collapse d-flex justify-content-between align-items-center">
<ol class="breadcrumb bg-light my-0 pl-0">

<li class="breadcrumb-item"><a href="" >Landing page</a></li>

<li class="breadcrumb-item"><a href="" >Collections</a></li>

<li class="breadcrumb-item"><a href=" èé/" >A test vector layer èé</a></li>

<li class="breadcrumb-item active">
Features in layer A test vector layer èé
<ul class="list-unstyled list-separated m-0 p-0 text-muted">

<li><a rel="alternate" href="" target="_blank">GEOJSON</a></li>


<div class="container pt-4">
<!-- END HEADER TEMPLATE header.html -->

<div class="row">
<nav aria-label="Page navigation example">
<ul class="pagination">

<!-- TODO: full pagination: li class="page-item"><a class="page-link" href="#">1</a></li>
<li class="page-item"><a class="page-link" href="#">2</a></li>
<li class="page-item"><a class="page-link" href="#">3</a></li-->


<div class="row">
<div class="col-md-6">
<h1>Features in layer A test vector layer èé</h1>

<h2><a href=" èé/items/0.html">A test vector layer èé 0</a></h2>
<dl class="row">

<dt class="col-sm-3">id</dt>
<dd class="col-sm-9">1</dd>

<dt class="col-sm-3">name</dt>
<dd class="col-sm-9">one</dd>

<dt class="col-sm-3">utf8nameè</dt>
<dd class="col-sm-9">one èé</dd>


<h2><a href=" èé/items/1.html">A test vector layer èé 1</a></h2>
<dl class="row">

<dt class="col-sm-3">id</dt>
<dd class="col-sm-9">2</dd>

<dt class="col-sm-3">name</dt>
<dd class="col-sm-9">two</dd>

<dt class="col-sm-3">utf8nameè</dt>
<dd class="col-sm-9">two àò</dd>


<h2><a href=" èé/items/2.html">A test vector layer èé 2</a></h2>
<dl class="row">

<dt class="col-sm-3">id</dt>
<dd class="col-sm-9">3</dd>

<dt class="col-sm-3">name</dt>
<dd class="col-sm-9">three</dd>

<dt class="col-sm-3">utf8nameè</dt>
<dd class="col-sm-9">three èé↓</dd>



<!-- template for the WFS3 API leaflet map -->
<div class="col-md-6">
<div id="mapid" class="small"></div>

<script type="text/javascript">
jQuery( document ).ready(function( $ ) {
var map ='mapid').setView([0, 0], 13);
L.tileLayer('https://{s}{z}/{x}/{y}.png', {
attribution: '&copy; <a href="">OpenStreetMap</a> contributors'
$.get( "", function( data ) {
var jl = L.geoJSON( data, {
onEachFeature: function (feature, layer) {
layer.bindPopup('<h1>' +'</h1>');
if ( jl.getBounds().getEast() != jl.getBounds().getWest() && jl.getBounds().getNorth() != jl.getBounds().getSouth() )
jl.on('featureOver', featureOver);



<!-- FOOTER TEMPLATE footer.html -->
</div> <!-- //container -->

<footer class="footer bg-light py-4 d-flex flex-column justify-content-around align-items-center">
<div class="container d-flex flex-row justify-content-between align-items-center w-100">
<span><span class="text-muted small mr-2">powered by</span><a class="navbar-brand" href="" target="_blank">QGIS Server</a></span>

<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<!-- Make sure you put this AFTER Leaflet's CSS -->
<script src=""

0 comments on commit b7b73a0

Please sign in to comment.