__ELIM__ V4_2_0_ASSDACIPS_DEMOMAPEA 3 - Filtros / Tipología - Categoría / Cluster
DEMO ASSDA CIPS -
Filtros Tipología - Cluster
by SIGC GUADALTEL
HTML
<link rel="stylesheet" href="https://sigc.desarrollo.guadaltel.es/mapea42/assets/css/mapea.ol.min.css">
<link rel="stylesheet" href="https://sigc.desarrollo.guadaltel.es/mapea42/plugins/geosearchbylocation/geosearchbylocation.min.css">
<link rel="stylesheet" href="https://sigc.desarrollo.guadaltel.es/mapea42/plugins/wfstcontrols/wfstcontrols.min.css">
<link rel="stylesheet" href="https://sigc.desarrollo.guadaltel.es/mapea42/plugins/geosearch/geosearch.min.css">
<link rel="stylesheet" href="https://sigc.desarrollo.guadaltel.es/mapea42/plugins/printer/printer.min.css">
<link rel="stylesheet" href="https://sigc.desarrollo.guadaltel.es/mapea42/plugins/measurebar/measurebar.min.css">
<link rel="stylesheet" href="https://sigc.desarrollo.guadaltel.es/mapea42/plugins/streetview/streetview.min.css">
<script src="https://sigc.desarrollo.guadaltel.es/mapea42/vendor/browser-polyfill.js"></script>
<script src="https://sigc.desarrollo.guadaltel.es/mapea42/js/mapea.ol.min.js"></script>
<script src="https://sigc.desarrollo.guadaltel.es/mapea42/js/configuration.js"></script>
<script src="https://sigc.desarrollo.guadaltel.es/mapea42/plugins/geosearchbylocation/geosearchbylocation.ol.min.js"></script>
<script src="https://sigc.desarrollo.guadaltel.es/mapea42/plugins/wfstcontrols/wfstcontrols.ol.min.js"></script>
<script src="https://sigc.desarrollo.guadaltel.es/mapea42/plugins/geosearch/geosearch.ol.min.js"></script>
<script src="https://sigc.desarrollo.guadaltel.es/mapea42/plugins/printer/printer.ol.min.js"></script>
<script src="https://sigc.desarrollo.guadaltel.es/mapea42/plugins/measurebar/measurebar.ol.min.js"></script>
<script src="https://sigc.desarrollo.guadaltel.es/mapea42/plugins/attributetable/attributetable.ol.min.js"></script>
<link rel="stylesheet" href="https://sigc.desarrollo.guadaltel.es/mapea42/plugins/attributetable/attributetable.min.css">
<div id="PanelTipologia" class="closePanel panel">
<input type="checkbox" onclick="tipologiaFilter()" name="panel"...
CSS
html,
body {
margin: 0;
padding: 0;
height: 100%;
overflow: hidden;
}
.m-popup{
position: fixed;
bottom: inherit;
left: initial;
top: 0;
right: 0;
z-index: 9999;
}
.m-popup:before {
border-top-color: initial;
border-width: 0;
left: inherit;
margin-left: 0;
}
.m-popup:after, .m-popup:before {
top: 0;
border: inherit;
content: " ";
height: 0;
width: 0;
position: inherit;
pointer-events: inherit;
}
.m-popup tr:nth-child(odd) {
background-color: rgba(41, 105, 168, 0.78);
color: white;
}
.tooltip {
position: relative;
padding: 3px;
background: rgba(0, 0, 0, 0.9);
color: white;
opacity: 0.7;
white-space: nowrap;
font: 10pt sans-serif;
}
#categoria{
background-color: rgba(55, 126, 235, 0.64);
padding: 6px;
border: 2px solid black;
}
.panel {
display: none;
padding: 10px;
background-color: #f6f6f6;
width: 200px;
cursor: pointer;
}
.closePanel {
display: none;
}
.openPanel {
display: block;
position: fixed;
bottom: inherit;
left: initial;
top: 0;
right: 0;
z-index: 9999;
border: 6px solid #5e8fb7;
}
JavaScript
function openPanel() {
if (document.getElementById("PanelTipologia").className.indexOf("openPanel") >= 0) {
document.getElementById("PanelTipologia").classList.remove("openPanel");
document.getElementById("PanelTipologia").classList.add("closePanel");
} else {
document.getElementById("PanelTipologia").classList.add("openPanel");
document.getElementById("PanelTipologia").classList.remove("closePanel");
}
}
var mapajs = M.map({
'container': 'map',
"controls": ["layerswitcher", "mouse", "scale", "overviewmap", "panzoombar", "scaleline", ],
"getfeatureinfo": "plain"
});
var centros = new M.layer.WFS({
name: "Centros ASSDA",
url: "https://clientes.guadaltel.es/desarrollo/geossigc/wfs?",
namespace: "mapea",
name: "centrosassda",
legend: "centrosassda",
getfeatureinfo: "plain",
geometry: 'POINT',
extract: true,
});
centros.on(M.evt.LOAD, function() {
centros.setStyle(categoryStyle);
centros.setStyle(new M.style.Cluster(options, vendorParameters));
});
centros.on(M.evt.SELECT_FEATURES, function(features) {
features.forEach(function(feature) {
//logFeature(feature);
if (feature.getGeoJSON().properties.features) {
//console.log('Es un cluster');
} else {
//console.log('Es un feature');
// Creamos el html de la pestaña
var fs = "<table width='500'>";
var keys = Object.keys(feature.getGeoJSON().properties);
keys.remove("ogc_fid");
keys.remove("concierto");
keys.remove("xx");
keys.remove("longitud");
keys.remove("latitud");
keys.remove("tipo");
keys.forEach(function atributos(key) {
if (feature.getAttribute(key) != "") {
fs += '<tr><td>';
fs += '\t<b>' + key + '</b>: ' + feature.getAttribute(key);
fs +=...