I need to build a Leaflet map loading data from this external WFS service


with these output formats

   <Format>text/xml; subtype=gml/3.1.1</Format>

Here you are a sample of the data


I know how to load an external WFS if the output format: here you are a sample

  <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.5/leaflet.css" />
  <title>Get External JSONP</title>
  <script src="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.js"></script>
  <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
  <div style="width:1000px; height:700px" id="map"></div>
      var osm = new L.TileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
        { attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors' }

      //create map object
      var map = new L.Map('map', {
          center: [42, 12],
          zoom: 6,
          layers: [osm]

      var geojsonLayer = new L.GeoJSON();

      function getJson(data) {

          url: "http://localhost:8080/opengeo-docs/ScuoleTorino.jsonp",
          jsonpCallback: 'getJson',
          success: getJson


... but this obviously doesn't work with GML.

Any suggestions in case of GML output formats?

  • Cesare, have you find a solution ?
    – delaye
    Nov 20, 2014 at 13:25
  • Your question is slightly confusing... You make a GetCapabilities request with no version specified and get a WFS 1.1.0 response (the highest version supported by the service). But then you make a WFS 1.0.0 GetFeature request, which doesn't support the version you want. then you show some JavaScript example using GeoJSON. Did you try any code to load data through a WFS 1.1.0 GetFeature request?
    – nmtoken
    Jan 25, 2017 at 21:04

1 Answer 1


It looks like the Leaflet-WFST Plugin is a solution to this problem.

var map = L.map('map').setView([0, 0], 2);

var boundaries = new L.WFS({
    url: 'http://demo.opengeo.org/geoserver/ows',
    typeNS: 'topp',
    typeName: 'tasmania_state_boundaries',
    crs: L.CRS.EPSG4326,
    style: {
        color: 'blue',
        weight: 2
  .on('load', function () {

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.