[CP-CHAP-12] - TEST - filtro 2layers
by SIGC GUADALTEL
HTML
<script src="https://sigc.desarrollo.guadaltel.es/mapea42_dev/js/mapea.ol.min.js"></script>
<script src="https://sigc.desarrollo.guadaltel.es/mapea42_dev/js/configuration.js"></script>
<link rel="stylesheet" href="https://sigc.desarrollo.guadaltel.es/mapea42_dev/assets/css/mapea.ol.min.css">
<script src="https://sigc.desarrollo.guadaltel.es/mapea42_dev/vendor/browser-polyfill.js"></script>
<link rel="stylesheet" href="https://sigc.desarrollo.guadaltel.es/mapea42_dev/plugins/printer/printer.min.css">
<script src="https://sigc.desarrollo.guadaltel.es/mapea42_dev/plugins/printer/printer.ol.min.js"></script>
<button id="btnFiltrar" onclick="setFiltro()">
Filtrar</button>
<button id="filtrar" onclick="limpiar();">
Limpiar filtro
</button>
<div id="map"></div>
CSS
html,
body {
margin: 0;
padding: 0;
height: 100%;
overflow: hidden;
}
JavaScript
let mapajs = M.map({
container: "map",
wmcfile: "callejero",
controls: ["layerswitcher"]
});
mapajs.addPlugin(new M.plugin.Printer({
"params": {
"pages": {
"clientLogo": "http://www.juntadeandalucia.es/economiayhacienda/images/plantilla/logo_cabecera.gif",
"creditos": "Impresión generada a través de Mapea"
},
"layout": {
"outputFilename": "mapea_${yyyy-MM-dd_hhmmss}"
}
}
}, {
"options": {
"legend": "true"
}
}));
let lySevilla = new M.layer.WFS({
name: "Provincias",
url: "http://geostematicos-sigc.juntadeandalucia.es/geoserver/tematicos/wfs",
namespace: "tematicos",
cql: "nombre='Sevilla'"
});
lySevilla.on(M.evt.LOAD, function() {
lySevilla.setStyle(new M.style.Polygon({
stroke: {
color: 'yellow',
width: 3
}
}));
});
let lyComarcas = new M.layer.WFS({
name: "comarcas",
url: "http://geostematicos-sigc.juntadeandalucia.es/geoserver/tematicos/wfs",
namespace: "tematicos"
});
lyComarcas.setStyle(new M.style.Polygon({
stroke: {
color: 'white',
width: 3
},
fill:{
color: 'blue',
opacity: 0.3
}
}));
let f = new M.Feature("f", {
"type": "Feature",
"id": "f",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[186811.8571096273, 4071466.260144673],
[186811.8571096273, 4251380.3702658685],
[355698.63041960564, 4251380.3702658685],
[355698.63041960564, 4071466.260144673],
[186811.8571096273, 4071466.260144673]
]
]
},
"properties": {"nombre":"envelope"}
});
let f2 = new M.Feature("f2", {
"type": "Feature",
"id": "f",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[199811.8571096273, 4041466.260144673],
[199811.8571096273, 4221380.3702658685],
[358698.63041960564, 4221380.3702658685],
[358698.63041960564, 4041466.260144673],
[199811.8571096273, 4041466.260144673]
]
]
},
"properties":...