[Wiki] Mapea 4 - WFS

by Francisco

HTML

<script src="http://mapea4-sigc.juntadeandalucia.es/js/configuration.js"></script>
<script src="http://mapea4-sigc.juntadeandalucia.es/js/mapea-5.0.0.ol.min.js"></script>
<link rel="stylesheet" href="http://mapea4-sigc.juntadeandalucia.es/assets/css/mapea-5.0.0.ol.min.css">
<div id="map"></div>

CSS

html,
body,
#map {
  padding: 0;
  margin: 0;
  width: 100%;
  height: 100%;
}

JavaScript

// En el constructor
var mapajs = M.map({
  container: "map",
  controls: ["layerswitcher"],
  wmcfiles: ["cdau"],
  layers: ["WFST*Campamentos*http://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows?*sepim:campamentos*MPOINT"]
});

// Con metodos
var layer = new M.layer.WFS({
url: "http://geostematicos-sigc.juntadeandalucia.es/geoserver/tematicos/ows?",
namespace: "tematicos",
name: "Provincias",
legend: "Provincias",
geometry: 'MPOLYGON',
ids:"3,4"
}, {}, {
  renderMode: "image"
});

mapajs.addWFS(layer);