var mapajs = M.map({
container: "map",
wmcfile: "callejero"
}).addPlugin(new M.plugin.AttributeTable());
// Capa de puntos
var layer = new M.layer.WFS("WFST*capa wfs*http://clientes.guadaltel.es/desarrollo/geossigc/wfs?*mapea:prueba_pun_wfst*MPOINT");
// capa de provincias
var lyProvincias = new M.layer.WFS({
url: "http://geostematicos-sigc.juntadeandalucia.es/geoserver/tematicos/ows?",
namespace: "tematicos",
name: "Provincias",
legend: "Provincias",
geometry: "MPOLYGON"
});
mapajs.addLayers(layer);
mapajs.addLayers(lyProvincias);
// Filtra el punto cuya is es prueba_pun_wfst.1619
function filterById() {
let filtro = new M.filter.Function(
function(feature) {
return feature.getId() === "prueba_pun_wfst.1619";
}
);
layer.setFilter(filtro);
}
//Ejemplo filtro and
// Filtra aquellos puntos que tienen id prueba_pun_wfst.1617
// y el atributo cod_gesta es 0
function filterAnd() {
let filtroId = new M.filter.Function(
function(feature) {
return feature.getId() === "prueba_pun_wfst.1617";
});
let filtroGeometry = new M.filter.Function(
function(feature) {
return feature.getAttributes().cod_gesta === 0;
});
let filterAnd = M.filter.AND([filtroId, filtroGeometry])
layer.setFilter(filterAnd);
}
//Ejemplo filtro or
// Filtra aquellos puntos que tienen id prueba_pun_wfst.1617
// o prueba_pun_wfst.1616
function filterOr() {
let filtroIdA = new M.filter.Function(
function(feature) {
return feature.getId() === "prueba_pun_wfst.1616";
}
);
let filtroIdB = new M.filter.Function(
function(feature) {
return feature.getId() === "prueba_pun_wfst.1617";
}
);
let filterOr = M.filter.OR([filtroIdA, filtroIdB]);
layer.setFilter(filterOr);
}
//Ejemplo concatenando filtros
// Filtra los puntos que tengan los id 1616, 1617 o 1622
function filterOrConcat() {
let filtroA = new M.filter.Function(function(feature) {
return feature.getId() === "prueba_pun_wfst.1616";
...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.