var map, mapDiv, Ext, popup, mapPanel, centerPanel, northPanel, legendPanel, westPanel, aboutPanel, layerTree, opacitySlider, navCtrl, infoCtrl, selectCtrl, permalinkProvider, mapLink, keyboardnav, layerRuler, bingmap, bingsat, binghyb, gmap, gsat, ghyb, gphy, mapquestOSM, mapquestOAM, OSMterrain,fullScreenButton;
var geographic = new OpenLayers.Projection("EPSG:4326");
var mercator = new OpenLayers.Projection("EPSG:900913");
var limites = new OpenLayers.Bounds(278260.73904136755, 6353233.057119656,293502.0555221541, 6360915.67160904).transform(geographic, mercator);
var elcentro = new OpenLayers.LonLat(-71.247475,-32.880061).transform(geographic, mercator);
var geoserver = 'http://192.168.2.104/';
// BEGIN LOADING MASK
Ext.onReady(function () {
setTimeout(function () {
Ext.get('loading').remove();
Ext.get('loading-mask').fadeOut({
remove: true
});
}, 250);
});
OpenLayers.Lang.en = {
'Escala': "1 : ${scaleDenom}"
};
function getCookie(c_name) {
var i, x, y, ARRcookies = document.cookie.split(";");
for (i = 0; i < ARRcookies.length; i++) {
x = ARRcookies[i].substr(0, ARRcookies[i].indexOf("="));
y = ARRcookies[i].substr(ARRcookies[i].indexOf("=") + 1);
x = x.replace(/^\s+|\s+$/g, "");
if (x == c_name) {
return unescape(y);
}
}
}
function setCookie(c_name, value, exdays) {
var exdate = new Date();
exdate.setDate(exdate.getDate() + exdays);
var c_value = escape(value) + ((exdays == null) ? "" : "; expires=" + exdate.toUTCString());
document.cookie = c_name + "=" + c_value;
}
function checkDisclaimer() {
var disclaimer = getCookie("disclaimer");
if (disclaimer == "accepted") {
}
else {
var disclaimerWin = new Ext.Window({
layout: 'fit',
modal: true,
title: '
Informacion Importante',
width: 500,
height: 150,
closable: false,
resizable: false,
plain: true,
border: true,
closeAction: 'hide',
html: 'Hemos modificado el mapa y aun no están operativas todas las funciones, paciencia, pronto lo estarán.
',
buttons: [{
text: 'Ir al Mapa',
handler: function () {
setCookie("disclaimer", "accepted", 0);
disclaimerWin.hide();
}
}]
});
disclaimerWin.show();
}
}var BuscaPredios = new Ext.form.TextField({
emptyText: 'Buscar Rol',
id : 'BuscaPredios',
width: 110,
labelWidth: 160,
margin: "0 2 0 0",
listeners: {
specialkey: function(f,e){
if(e.getKey() == e.ENTER){
var rolabuscar=formatearol(BuscaPredios.getValue());
BuscaPredios.setValue(formatearol(rolabuscar));
dibujaRol(rolabuscar);
//Ext.getCmp('BuscaDireccion').focus(false, 100);
}
},
"focus": function () {
keyboardnav.deactivate();
},
"blur": function () {
keyboardnav.activate();
}
}
});var BuscaDireccion = new Ext.form.TextField({
emptyText: 'Buscar Dirección',
width: 110,
labelWidth: 160,
margin: "0 2 0 0",
listeners: {
specialkey: function(f,e){
if(e.getKey() == e.ENTER){
/*
$.ajax({
type: "GET",
url: "/geoserver/wfs?service=wfs&version=1.1.0&request=GetFeature&typeName=SIGPrivado:urbano&Filter=ROL"+rolabuscar+"",
dataType: 'xml',
async: false,
success: function(xml) {
vectorLayer.removeAllFeatures(); //limpio todo resultado antes de pintar de nuevo
$(xml).find("gml\\:LinearRing , LinearRing").each(function(){
var tmp = $(this).find('gml\\:posList, posList').text();
var arreglo = tmp.split(' ');
latlon1 = ToLL(parseFloat(arreglo[0]) - 80,parseFloat(arreglo[1]) - 80,19);
latlon2 = ToLL(parseFloat(arreglo[0]) + 80,parseFloat(arreglo[1]) + 80,19);
map.zoomToExtent(new OpenLayers.Bounds(latlon1[0], latlon1[1], latlon2[0], latlon2[1]).transform(geographic, mercator));
function removeA(arr){
var what, a= arguments, L= a.length, ax;
while(L> 1 && arr.length){
what= a[--L];
while((ax= arr.indexOf(what))!= -1){
arr.splice(ax, 1);
}
}
return arr;
}
removeA(arreglo,'0.0');
for (var i=0;iROL"+rolabuscar+"",
dataType: 'xml',
async: false,
success: function(xml) {
$(xml).find("gml\\:LinearRing , LinearRing").each(function(){
var tmp = $(this).find('gml\\:posList, posList').text();
var arreglo = tmp.split(' ');
latlon1 = ToLL(parseFloat(arreglo[0]) - 80,parseFloat(arreglo[1]) - 80,19);
latlon2 = ToLL(parseFloat(arreglo[0]) + 80,parseFloat(arreglo[1]) + 80,19);
map.zoomToExtent(new OpenLayers.Bounds(latlon1[0], latlon1[1], latlon2[0], latlon2[1]).transform(geographic, mercator));
function removeA(arr){
var what, a= arguments, L= a.length, ax;
while(L> 1 && arr.length){
what= a[--L];
while((ax= arr.indexOf(what))!= -1){
arr.splice(ax, 1);
}
}
return arr;
}
removeA(arreglo,'0.0');
for (var i=0;iMapQuest ',
transitionEffect: "resize"
});
OSMterrain = new OpenLayers.Layer.XYZ("OpenStreetMap Terrain", "http://tile.stamen.com/terrain/${z}/${x}/${y}.jpg", {
attribution: 'Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA',
transitionEffect: "resize",
tileOptions: {
crossOriginKeyword: null
}
});
layerRuler = new OpenLayers.Layer.Vector("Measurements", {
displayInLayerSwitcher: false
});
//******************test***************************************************************
highlightLayer = new OpenLayers.Layer.Vector("Highlighted Features", {
displayInLayerSwitcher: false,
isBaseLayer: false,
styleMap: new OpenLayers.StyleMap({
"default": new OpenLayers.Style(OpenLayers.Util.applyDefaults({
strokeColor: '#4BFFFF',
strokeWidth: 3,
fillOpacity: 0
}, OpenLayers.Feature.Vector.style["default"]))
})
});
//*****************************************************************************
vias = new OpenLayers.Layer.WMS("Vias", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:vias_comuna",transparent: true},{isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
conjuntos_residenciales = new OpenLayers.Layer.WMS("Conjuntos Residenciales", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:conjuntos_residenciales_etapas",transparent: true}, {isBaseLayer: false,singleTile: false,opacity: 1,visibility: false,displayInLayerSwitcher: true});
sectores_urbanos = new OpenLayers.Layer.WMS("Unidades Vecinales Urbanas", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:uuvv_urbanas",transparent: true}, {isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
sectores_rurales = new OpenLayers.Layer.WMS("Unidades Vecinales Rurales", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:uuvv_rurales",transparent: true}, {isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
prediosrurales = new OpenLayers.Layer.WMS("Predios Rurales", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:rural",transparent: true}, {isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
predios_con_permiso_y_recepcion_2022 = new OpenLayers.Layer.WMS("Predios con Permiso Recepcion 2022", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:predios_con_permiso_y_recepcion_2022",transparent: true}, {isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
prediosurbanos = new OpenLayers.Layer.WMS("Predios Urbanos", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:urbano",transparent: true}, {isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
limiteurbano = new OpenLayers.Layer.WMS("Limite Urbano", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:limite_urbano_1",transparent: true}, {isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
etapas_antumapu = new OpenLayers.Layer.WMS("Etapas Antumapu", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:etapas_antumapu",transparent: true}, {isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
seccional_oriente = new OpenLayers.Layer.WMS("Seccional Oriente", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:sector_oriente",transparent: true}, {isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
seccional_oriente = new OpenLayers.Layer.WMS("Seccional Oriente", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:sector_oriente",transparent: true}, {isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
etapas_sendero = new OpenLayers.Layer.WMS("Etapas El Sendero", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:etapas_sendero",transparent: true}, {isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
limite_comunal_pol = new OpenLayers.Layer.WMS("Limite Comunal", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:limite_comunal_pol",transparent: true}, {isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
Construcciones_2015 = new OpenLayers.Layer.WMS("Construcciones 2015", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:Construcciones_2015",transparent: true}, {isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
AreasVerdes2020 = new OpenLayers.Layer.WMS("AreasVerdes 2020", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:AreasVerdes2020",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
MaquinasEjercicio = new OpenLayers.Layer.WMS("Maquinas de Ejercicio", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:maquinasejercicio",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
paradero = new OpenLayers.Layer.WMS("Paradero", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:paradero",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
maquinasejercicio = new OpenLayers.Layer.WMS("Maquinas de ejercicio", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:maquinasejercicio",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
campos_deportivos = new OpenLayers.Layer.WMS("Campos Deportivos", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:campos_deportivos",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
sedes_comunitarias = new OpenLayers.Layer.WMS("Sedes Comunitarias", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:sedes_comunitarias",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
panaderia = new OpenLayers.Layer.WMS("Panaderias", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:panaderias_",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
semaforos = new OpenLayers.Layer.WMS("Semaforos", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:semaforos",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
camaras_de_seguridad = new OpenLayers.Layer.WMS("Camaras de Seguridad", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:camaras_de_seguridad",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
senaletica = new OpenLayers.Layer.WMS("Señaletica", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:senaletica",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
lomo_de_toro = new OpenLayers.Layer.WMS("Lomos de Toro", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:lomo_de_toro",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
colector_agua_lluvia = new OpenLayers.Layer.WMS("Colector Agua Lluvia", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:colector_agua_lluvia",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
comedores = new OpenLayers.Layer.WMS("Comedores Solidarios", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:comedores_solidarios",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
comunitarios = new OpenLayers.Layer.WMS("Asociación Adultos Mayores", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:comunitarios",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
programas_dideco = new OpenLayers.Layer.WMS("Programas DIDECO", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:programas_dideco",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
establecimientos_educacionales = new OpenLayers.Layer.WMS("Establecimientos Educacionales", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:establecimientos_educacionales",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
servicios_financieros = new OpenLayers.Layer.WMS("Servicios Financieros", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:servicios_financieros",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
cajeros = new OpenLayers.Layer.WMS("Cajeros Automaticos", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:cajeros_automaticos",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
supermercados = new OpenLayers.Layer.WMS("Supermercados", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:supermercados_",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
farmacias = new OpenLayers.Layer.WMS("Farmacias", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:farmacias",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
almacenes = new OpenLayers.Layer.WMS("Almacenes", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:almacenes",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
arbolesmuertos = new OpenLayers.Layer.WMS("Arboles Muertos", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:individuos_muertos",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
arbolesprotegidos = new OpenLayers.Layer.WMS("Especies Protegidas", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:especies_protegidas",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
campanas = new OpenLayers.Layer.WMS("Campanas acopio plastico", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:campanas",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
jaulas = new OpenLayers.Layer.WMS("Campanas acopio vidrio", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:jaulas",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
vegetacion_2015 = new OpenLayers.Layer.WMS("Vegetación 2015 ", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:vegetacion_2015",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
aseolunes = new OpenLayers.Layer.WMS("Recorrido Lunes", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:lunes",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
aseomartes = new OpenLayers.Layer.WMS("Recorrido Martes", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:martes",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
aseomiercoles = new OpenLayers.Layer.WMS("Recorrido Miercoles", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:miercoles",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
aseojueves = new OpenLayers.Layer.WMS("Recorrido Jueves", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:jueves",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
aseoviernes = new OpenLayers.Layer.WMS("Recorrido Viernes", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:viernes",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
aseosabado = new OpenLayers.Layer.WMS("Recorrido Sabado", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:sabado",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
aseonocturno = new OpenLayers.Layer.WMS("Recorrido Nocturno", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:nocturno",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
L_nea_San_Pedro___Las_Vegas= new OpenLayers.Layer.WMS("Linea AesGener SanPedro/LasVegas", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:L_nea_San_Pedro___Las_Vegas",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
L_nea_Ventanas___San_Pedro= new OpenLayers.Layer.WMS("Linea AesGener Ventanas/SanPedro", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:L_nea_Ventanas___San_Pedro",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
unidadespoliciales = new OpenLayers.Layer.WMS("Unidades Policiales", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:unidades_policiales",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
bomberos = new OpenLayers.Layer.WMS("Cuarteles Bomberos", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:bomberos",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
incendio_forestal_recurrente = new OpenLayers.Layer.WMS("Incendios Forestales recurrentes", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:incendio_forestal_recurrente",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
linea_cota_30 = new OpenLayers.Layer.WMS("Cota 30", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:linea_cota_30",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
almacenamiento_y_venta_combustibles = new OpenLayers.Layer.WMS("Almacenamiento y Venta Combustibles", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:almacenamiento_y__venta_combustibles",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
plan_cuadrante = new OpenLayers.Layer.WMS("Plan Cuadrante", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:plan_cuadrante",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
grifo = new OpenLayers.Layer.WMS("Grifos", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:grifo",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
covidweigth_4 = new OpenLayers.Layer.WMS("Índice Vulnerabilidad", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:weigth_4",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
covidsocioecon = new OpenLayers.Layer.WMS("Índice V. Socioeconómica", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:socioecon",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
covidmat_irre_zc = new OpenLayers.Layer.WMS("Índice Materialidad", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:mat_irre_zc",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
covidhacinamiento_zc = new OpenLayers.Layer.WMS("Índice Hacinamiento", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:hacinamiento_zc",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
covidadul_mayores_zc = new OpenLayers.Layer.WMS("Índice Adultos Mayores", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:adul_mayores_zc",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
carboreo = new OpenLayers.Layer.WMS("Censo Arbóreo", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:CAUQF",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
centrossalud = new OpenLayers.Layer.WMS("Centros de Salud", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:centros_salud_quillota",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
viviendaspolygon = new OpenLayers.Layer.WMS("Manzanas Censales", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:viviendaspolygon",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
edad65ymaspolygon = new OpenLayers.Layer.WMS("Poblacion 65+", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:edad65ymaspolygon",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
distritos_comunales_con_info = new OpenLayers.Layer.WMS("Distritos Censales", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:distritos_comunales_con_info",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
edad0a5polygon = new OpenLayers.Layer.WMS("Poblacion 0a5 año", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:edad0a5polygon",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
edad6a14polygon = new OpenLayers.Layer.WMS("Poblacion 6a14años", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:edad6a14polygon",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
edad15a64polygon = new OpenLayers.Layer.WMS("Poblacion 15a64años", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:edad15a64polygon",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
conjuntos_urbanos = new OpenLayers.Layer.WMS("Conj. Residenciales por decadas", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:conjuntos_urbanos",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
canales_quillota = new OpenLayers.Layer.WMS("Canales de regadío", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:canales_quillota",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
cajas_vecinas = new OpenLayers.Layer.WMS("Caja Vecina", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:cajas_vecinas",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
emprendedores = new OpenLayers.Layer.WMS("Emprendedores ODE", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:emprendedores",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
ferias_itinerantes = new OpenLayers.Layer.WMS("Ferias Itinerantes", "https://ide.emprendequillota.cl/geoserver/ows?", {
layers: "geonode:ferias_itinerantes",transparent: true}, { isBaseLayer: false,singleTile: false,visibility: false,displayInLayerSwitcher: true});
var treeConfig = [{
text: " Capas Públicas",
expanded: true,
singleClickExpand: true,
children: [
{ text: "Medio Ambiente",
expanded: false,
singleClickExpand: true,
children: [
{nodeType: "gx_layer",layer: carboreo ,extent: elcentro,originator: "carboreo",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: arbolesmuertos ,extent: elcentro,originator: "arbolesmuertos",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: arbolesprotegidos ,extent: elcentro,originator: "arbolesprotegidos",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: campanas ,extent: elcentro,originator: "campanas",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: jaulas ,extent: elcentro,originator: "jaulas",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: vegetacion_2015 ,extent: elcentro,originator: "vegetacion_2015",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: canales_quillota ,extent: elcentro,originator: "canales_quillota",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: AreasVerdes2020 ,extent: elcentro,originator: "AreasVerdes2020",updated: "",metadata: "",abstract: "",queries: []},
{ text: "Recorrido Aseo",
expanded: false,
singleClickExpand: true,
children: [
{nodeType: "gx_layer",layer: aseolunes ,extent: elcentro,originator: "aseolunes",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: aseomartes,extent: elcentro,originator: "aseomartes",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: aseomiercoles,extent: elcentro,originator: "aseomiercoles",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: aseojueves,extent: elcentro,originator: "aseojueves",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: aseoviernes,extent: elcentro,originator: "aseoviernes",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: aseosabado,extent: elcentro,originator: "aseosabado",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: aseonocturno,extent: elcentro,originator: "aseonocturno",updated: "",metadata: "",abstract: "",queries: []},
]
}
]
},
{ text: "Educación",
expanded: false,
singleClickExpand: true,
children: [
{nodeType: "gx_layer",layer: establecimientos_educacionales ,extent: elcentro,originator: "establecimientos_educacionales",updated: "",metadata: "",abstract: "",queries: []},
]
},
{ text: "Salud",
expanded: false,
singleClickExpand: true,
children: [
{nodeType: "gx_layer",layer: centrossalud ,extent: elcentro,originator: "centrossalud",updated: "",metadata: "",abstract: "",queries: []},
]
},
{ text: "Territorio",
expanded: true,
singleClickExpand: true,
children: [
{nodeType: "gx_layer",layer: prediosurbanos ,extent: elcentro,originator: "prediosurbanos",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: prediosrurales ,extent: elcentro,originator: "prediosrurales",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: sectores_rurales ,extent: elcentro,originator: "sectores_rurales",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: sectores_urbanos ,extent: elcentro,originator: "sectores_urbanos",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: conjuntos_residenciales ,extent: elcentro,originator: "conjuntos_residenciales",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: predios_con_permiso_y_recepcion_2022 ,extent: elcentro,originator: "predios_con_permiso_y_recepcion_2022",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: vias ,extent: elcentro,originator: "vias",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: etapas_antumapu ,extent: elcentro,originator: "etapas_antumapu",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: etapas_sendero ,extent: elcentro,originator: "etapas_sendero",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: seccional_oriente ,extent: elcentro,originator: "seccional_oriente",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: limiteurbano ,extent: elcentro,originator: "limiteurbano",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: limite_comunal_pol ,extent: elcentro,originator: "limite_comunal_pol",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: conjuntos_urbanos ,extent: elcentro,originator: "conjuntos_urbanos",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: Construcciones_2015 ,extent: elcentro,originator: "Construcciones_2015",updated: "",metadata: "",abstract: "",queries: []},
]
},
{ text: "Protección Civil",
expanded: false,
singleClickExpand: true,
children: [
{nodeType: "gx_layer",layer: unidadespoliciales,extent: elcentro,originator: "unidadespoliciales",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: bomberos,extent: elcentro,originator: "bomberos",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: incendio_forestal_recurrente,extent: elcentro,originator: "incendio_forestal_recurrente",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: linea_cota_30,extent: elcentro,originator: "linea_cota_30",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: almacenamiento_y_venta_combustibles,extent: elcentro,originator: "almacenamiento_y_venta_combustibles",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: plan_cuadrante,extent: elcentro,originator: "plan_cuadrante",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: L_nea_San_Pedro___Las_Vegas,extent: elcentro,originator: "L_nea_San_Pedro___Las_Vegas",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: L_nea_Ventanas___San_Pedro,extent: elcentro,originator: "L_nea_Ventanas___San_Pedro",updated: "",metadata: "",abstract: "",queries: []},
]
},
{ text: "Equipamiento",
expanded: false,
singleClickExpand: true,
children: [
{nodeType: "gx_layer",layer: maquinasejercicio ,extent: elcentro,originator: "maquinasejercicio",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: campos_deportivos ,extent: elcentro,originator: "campos_deportivos",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: paradero ,extent: elcentro,originator: "paradero",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: sedes_comunitarias ,extent: elcentro,originator: "sedes_comunitarias",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: grifo ,extent: elcentro,originator: "grifo",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: colector_agua_lluvia ,extent: elcentro,originator: "colector_agua_lluvia",updated: "",metadata: "",abstract: "",queries: []},
]
},
{ text: "Transito",
expanded: false,
singleClickExpand: true,
children: [
{nodeType: "gx_layer",layer: semaforos ,extent: elcentro,originator: "semaforos",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: camaras_de_seguridad ,extent: elcentro,originator: "camaras_de_seguridad",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: senaletica ,extent: elcentro,originator: "senaletica",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: lomo_de_toro ,extent: elcentro,originator: "lomo_de_toro",updated: "",metadata: "",abstract: "",queries: []},
]
},
{ text: "Desarrollo Económico",
expanded: false,
singleClickExpand: true,
children: [
{nodeType: "gx_layer",layer: emprendedores ,extent: elcentro,originator: "emprendedores",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: ferias_itinerantes ,extent: elcentro,originator: "ferias_itinerantes",updated: "",metadata: "",abstract: "",queries: []},
]
},
{ text: "Hazla Corta",
expanded: false,
singleClickExpand: true,
children: [
{nodeType: "gx_layer",layer: panaderia ,extent: elcentro,originator: "panaderia",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: supermercados ,extent: elcentro,originator: "supermercados",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: farmacias ,extent: elcentro,originator: "farmacias",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: almacenes ,extent: elcentro,originator: "almacenes",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: cajeros ,extent: elcentro,originator: "cajeros",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: servicios_financieros ,extent: elcentro,originator: "servicios_financieros",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: cajas_vecinas ,extent: elcentro,originator: "cajas_vecinas",updated: "",metadata: "",abstract: "",queries: []},
]
}
,
{ text: "Social",
expanded: false,
singleClickExpand: true,
children: [
{nodeType: "gx_layer",layer: comedores ,extent: elcentro,originator: "comedores",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: comunitarios ,extent: elcentro,originator: "comunitarios",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: programas_dideco ,extent: elcentro,originator: "programas_dideco",updated: "",metadata: "",abstract: "",queries: []},
]
}
,
{ text: "Covid 19",
expanded: false,
singleClickExpand: true,
children: [
{nodeType: "gx_layer",layer: covidweigth_4 ,extent: elcentro,originator: "covidweigth_4",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: covidsocioecon ,extent: elcentro,originator: "covidsocioecon",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: covidmat_irre_zc ,extent: elcentro,originator: "covidmat_irre_zc",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: covidhacinamiento_zc ,extent: elcentro,originator: "covidhacinamiento_zc",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: covidadul_mayores_zc ,extent: elcentro,originator: "covidadul_mayores_zc",updated: "",metadata: "",abstract: "",queries: []},
]
}
,
{ text: "Censo",
expanded: false,
singleClickExpand: true,
children: [
{nodeType: "gx_layer",layer: viviendaspolygon ,extent: elcentro,originator: "viviendaspolygon",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: edad65ymaspolygon ,extent: elcentro,originator: "edad65ymaspolygon",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: edad0a5polygon ,extent: elcentro,originator: "edad0a5polygon",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: edad6a14polygon ,extent: elcentro,originator: "edad6a14polygon",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: edad15a64polygon ,extent: elcentro,originator: "edad15a64polygon",updated: "",metadata: "",abstract: "",queries: []},
{nodeType: "gx_layer",layer: distritos_comunales_con_info ,extent: elcentro,originator: "distritos_comunales_con_info",updated: "",metadata: "",abstract: "",queries: []},
]
}
]
},
{
text: " Mapas de Fondo",
expanded: false,
singleClickExpand: true,
children: [
{
nodeType: "gx_layer",
layer: mapbox
},{
nodeType: "gx_layer",
layer: mapquestOSM
}
]
}];
map.addLayers([mapquestOSM, mapbox, prediosurbanos,predios_con_permiso_y_recepcion_2022, prediosrurales,conjuntos_residenciales,vias,AreasVerdes2020, limiteurbano,
aseoviernes,carboreo,arbolesmuertos, arbolesprotegidos,
aseolunes,aseomartes,aseomiercoles,aseojueves,aseoviernes,aseosabado,aseonocturno,unidadespoliciales,bomberos,covidadul_mayores_zc,
covidhacinamiento_zc,covidmat_irre_zc,covidsocioecon,covidweigth_4,centrossalud,etapas_antumapu,seccional_oriente,campanas, linea_cota_30,
incendio_forestal_recurrente,jaulas, campanas,semaforos,camaras_de_seguridad,almacenamiento_y_venta_combustibles,viviendaspolygon,
vegetacion_2015,servicios_financieros,sedes_comunitarias,senaletica,programas_dideco,plan_cuadrante,lomo_de_toro,etapas_sendero,grifo,
paradero, comedores, cajeros,almacenes, campos_deportivos,limite_comunal_pol,establecimientos_educacionales,cajas_vecinas,
edad65ymaspolygon,
distritos_comunales_con_info,
edad0a5polygon,
edad6a14polygon,comunitarios,
edad15a64polygon,
conjuntos_urbanos,Construcciones_2015,
colector_agua_lluvia,canales_quillota,
ferias_itinerantes, emprendedores,
supermercados, farmacias, maquinasejercicio, panaderia,
L_nea_San_Pedro___Las_Vegas,
L_nea_Ventanas___San_Pedro,
sectores_urbanos,sectores_rurales,layerRuler, vectorLayer, highlightLayer]);
selectCtrl = new OpenLayers.Control.WMSGetFeatureInfo({
url: "url",
title: 'Identify features by clicking',
layers: [predios_con_permiso_y_recepcion_2022,prediosurbanos,prediosrurales,conjuntos_residenciales,vias, aseoviernes,arbolesmuertos, arbolesprotegidos,aseolunes,aseomartes,aseomiercoles,aseojueves,aseoviernes,aseosabado,aseonocturno,unidadespoliciales,bomberos,covidadul_mayores_zc,covidhacinamiento_zc,covidmat_irre_zc,covidsocioecon,covidweigth_4,centrossalud,etapas_antumapu, seccional_oriente,campanas,linea_cota_30,incendio_forestal_recurrente,jaulas, canales_quillota,campanas,semaforos,camaras_de_seguridad,almacenamiento_y_venta_combustibles,viviendaspolygon,vegetacion_2015,servicios_financieros,sedes_comunitarias,senaletica,programas_dideco,plan_cuadrante,lomo_de_toro,etapas_sendero,grifo,paradero, comedores, cajeros,almacenes, carboreo,campos_deportivos,limite_comunal_pol,establecimientos_educacionales,cajas_vecinas,edad65ymaspolygon,distritos_comunales_con_info,edad0a5polygon,edad6a14polygon,edad15a64polygon,conjuntos_urbanos,colector_agua_lluvia,ferias_itinerantes, emprendedores,supermercados, farmacias, maquinasejercicio, panaderia,limiteurbano, comunitarios,sectores_urbanos,sectores_rurales,Construcciones_2015,AreasVerdes2020],
queryVisible: true,
maxFeatures: 2,
infoFormat: 'application/vnd.ogc.gml'
});
selectCtrl.events.on({
getfeatureinfo: function (e) {
selectFeatures(e);
}
});
function selectFeatures(e) {
if (e.features && e.features.length) {
feature = e.features;
}
};
infoCtrl = new OpenLayers.Control.WMSGetFeatureInfo({
url: "url",
title: "Identify features by clicking",
layers: [predios_con_permiso_y_recepcion_2022,prediosurbanos,prediosrurales,conjuntos_residenciales,vias, aseoviernes,arbolesmuertos, arbolesprotegidos,aseolunes,aseomartes,aseomiercoles,aseojueves,aseoviernes,aseosabado,aseonocturno,unidadespoliciales,bomberos,covidadul_mayores_zc,covidhacinamiento_zc,covidmat_irre_zc,covidsocioecon,covidweigth_4,centrossalud,etapas_antumapu, seccional_oriente,campanas,linea_cota_30,incendio_forestal_recurrente,jaulas, canales_quillota,campanas,semaforos,camaras_de_seguridad,almacenamiento_y_venta_combustibles,viviendaspolygon,vegetacion_2015,servicios_financieros,sedes_comunitarias,senaletica,programas_dideco,plan_cuadrante,lomo_de_toro,etapas_sendero,grifo,paradero, comedores, cajeros,almacenes, carboreo,campos_deportivos,limite_comunal_pol,establecimientos_educacionales,cajas_vecinas,edad65ymaspolygon,distritos_comunales_con_info,edad0a5polygon,edad6a14polygon,edad15a64polygon,conjuntos_urbanos,colector_agua_lluvia,ferias_itinerantes, emprendedores,supermercados, farmacias, maquinasejercicio, panaderia,limiteurbano, comunitarios,sectores_urbanos,sectores_rurales,Construcciones_2015,AreasVerdes2020],
queryVisible: true,
drillDown: true
});
infoCtrl.events.on({
getfeatureinfo: function (e) {
if (e.text.length > 687) {
createPopup(e);
}
if (e.text.length <= 687 && popup) {
popup.destroy();
}
}
});
function testAjax(html) {
}
function createPopup(e) {
if (!popup) {
popup = new GeoExt.Popup({
title: "Cuadro de Informacion",
viewConfig: 'fit',
margin: 5,
padding: 5,
autoScroll: true,
maximizable: true,
collapsible: true,
panIn: false,
map: map,
location: map.getLonLatFromPixel(e.xy),
//html: e.text
html: "Primero"
});
popup.show();
var maxWidth = parseInt(map.getSize().w - map.getSize().w/2);
var maxHeight = parseInt(map.getSize().h - map.getSize().h/4);
if (popup.getWidth() > maxWidth) {
popup.setWidth(maxWidth);
popup.show();
}
if (popup.getHeight() > maxHeight) {
popup.setHeight(maxHeight);
popup.show();
}
}
if (popup) {
popup.destroy();
vectorLayer.removeAllFeatures();
var filtrado = testAjax(e.text);
var rol= e.text;
popup = new GeoExt.Popup({
title: "Información",
width: 510,
height: 420,
//layout: 'fit',
//viewConfig: 'fit',
margin: 11,
//padding: 1,
autoScroll: true,
maximizable: true,
collapsible: true,
panIn: false,
map: map,
location: map.getLonLatFromPixel(e.xy),
//html: mensaje(e.text);
html: e.text
//*************************************************************************************************************/
//***************************************************************************************************************************************/
});
popup.show();
var maxWidth = parseInt(map.getSize().w - map.getSize().w/2);
var maxHeight = parseInt(map.getSize().h - map.getSize().h/4);
if (popup.getWidth() > maxWidth) {
popup.setWidth(maxWidth);
popup.show();
}
if (popup.getHeight() > maxHeight) {
popup.setHeight(maxHeight);
popup.show();
}
}
}
map.addControl(infoCtrl);
var linemeasureStyles = {
"Point": {
pointRadius: 4,
graphicName: "square",
fillColor: "white",
fillOpacity: 1,
strokeWidth: 1,
strokeOpacity: 1,
strokeColor: "#333333"
},
"Line": {
strokeColor: "#FF0000",
strokeOpacity: 0.3,
strokeWidth: 3,
strokeLinecap: "square"
}
};
var lineStyle = new OpenLayers.Style();
lineStyle.addRules([
new OpenLayers.Rule({
symbolizer: linemeasureStyles
})]);
var linemeasureStyleMap = new OpenLayers.StyleMap({
"default": lineStyle
});
var length = new OpenLayers.Control.Measure(OpenLayers.Handler.Path, {
displaySystem: "metric",
geodesic: true,
persist: true,
handlerOptions: {
layerOptions: {
styleMap: linemeasureStyleMap
}
},
textNodes: null,
callbacks: {
create: function () {
this.textNodes = [];
layerRuler.removeFeatures(layerRuler.features);
mouseMovements = 0;
},
modify: function (point, line) {
if (mouseMovements++ < 5) {
return;
}
var len = line.geometry.components.length;
var from = line.geometry.components[len - 2];
var to = line.geometry.components[len - 1];
var ls = new OpenLayers.Geometry.LineString([from, to]);
var dist = this.getBestLength(ls);
if (!dist[0]) {
return;
}
var total = this.getBestLength(line.geometry);
var label = dist[0].toFixed(2) + " " + dist[1];
var textNode = this.textNodes[len - 2] || null;
if (textNode && !textNode.layer) {
this.textNodes.pop();
textNode = null;
}
if (!textNode) {
var c = ls.getCentroid();
textNode = new OpenLayers.Feature.Vector(
new OpenLayers.Geometry.Point(c.x, c.y), {}, {
label: '',
fontColor: "#FF0000",
fontSize: "14px",
fontFamily: "Arial",
fontWeight: "bold",
labelAlign: "cm"
});
this.textNodes.push(textNode);
layerRuler.addFeatures([textNode]);
}
textNode.geometry.x = (from.x + to.x) / 2;
textNode.geometry.y = (from.y + to.y) / 2;
textNode.style.label = label;
textNode.layer.drawFeature(textNode);
this.events.triggerEvent("measuredynamic", {
measure: dist[0],
total: total[0],
units: dist[1],
order: 1,
geometry: ls
});
}
}
});
function handleMeasurements(event) {
var geometry = event.geometry;
var units = event.units;
var order = event.order;
var measure = event.measure;
var element = document.getElementById("output");
var acres;
var out = "";
if (order === 1) {
out += measure.toFixed(2) + " " + units;
} else if (order === 2 && units === "ft" && measure >= 43560) {
acres = measure / 43560;
out += acres.toFixed(2) + " acres";
} else {
out += measure.toFixed(2) + " " + units + "2" + "sup>";
}
element.innerHTML = " " + out;
}
length.events.on({
"measure": handleMeasurements,
"measurepartial": handleMeasurements
});
var areameasureStyles = {
"Point": {
pointRadius: 4,
graphicName: "square",
fillColor: "white",
fillOpacity: 1,
strokeWidth: 1,
strokeOpacity: 1,
strokeColor: "#333333"
},
"Polygon": {
strokeWidth: 3,
strokeOpacity: 1,
strokeColor: "red",
fillColor: "red",
fillOpacity: 0.3
}
};
var areaStyle = new OpenLayers.Style();
areaStyle.addRules([
new OpenLayers.Rule({
symbolizer: areameasureStyles
})]);
var areaStyleMap = new OpenLayers.StyleMap({
"default": areaStyle
});
var area = new OpenLayers.Control.Measure(OpenLayers.Handler.Polygon, {
displaySystem: "metric",
geodesic: true,
persist: true,
handlerOptions: {
layerOptions: {
styleMap: areaStyleMap
}
}
});
area.events.on({
"measure": handleMeasurements,
"measurepartial": handleMeasurements
});
map.addControl(length);
map.addControl(area);
this.activeIndex = 0;
var measureButton = new Ext.SplitButton({
id: "measureButton",
tooltip: "Herramienta de medicion",
iconCls: "icon-measure-length",
enableToggle: true,
toggleGroup: "navigation",
allowDepress: true,
handler: function (button, event) {
if (button.pressed) {
button.menu.items.itemAt(this.activeIndex).setChecked(true);
}
else {
Ext.getCmp("map").body.applyStyles("cursor:default");
//Ext.getCmp("measureButton").setIconClass("icon-measure-length");
}
},
scope: this,
listeners: {
toggle: function(button, pressed) {
// toggleGroup should handle this
if(!pressed) {
button.menu.items.each(function(i) {
i.setChecked(false);
});
}
},
render: function(button) {
// toggleGroup should handle this
Ext.ButtonToggleMgr.register(button);
}
},
menu: new Ext.menu.Menu({
items: [
new Ext.menu.CheckItem(
new GeoExt.Action({
text: "Medir Distancia",
iconCls: "icon-measure-length",
toggleGroup: "navigation",
group: "measure",
listeners: {
checkchange: function(item, checked) {
this.activeIndex = 0;
measureButton.toggle(checked);
if (checked) {
measureButton.setIconClass(item.iconCls);
Ext.getCmp("map").body.applyStyles("cursor:crosshair");
var element = document.getElementById("output");
element.innerHTML = "";
layerRuler.removeFeatures(layerRuler.features);
}
},
scope: this
},
map: map,
control: length
})
),
new Ext.menu.CheckItem(
new GeoExt.Action({
text: "Medir Area",
iconCls: "icon-measure-area",
toggleGroup: "navigation",
group: "measure",
allowDepress: false,
listeners: {
checkchange: function(item, checked) {
this.activeIndex = 1;
measureButton.toggle(checked);
if (checked) {
measureButton.setIconClass(item.iconCls);
Ext.getCmp("map").body.applyStyles("cursor:crosshair");
var element = document.getElementById("output");
element.innerHTML = "";
layerRuler.removeFeatures(layerRuler.features);
}
},
scope: this
},
map: map,
control: area
})
)
]
})
});
var storedir = new Ext.data.JsonStore({
autoLoad: false,
fields: [
{name: 'rol', type: 'int'},
'rol', 'Direcciones'
],
sortInfo: {
field: "Direcciones",
direction: "ASC"
},
proxy: new Ext.data.HttpProxy({
url: "../SIG/jstore/dir2.php"
})
});
var BuscaDireccion = new Ext.form.ComboBox({
tpl: '{rol} {Direcciones}
',
//triggerAction: 'all',
store: storedir,
displayField: 'Direcciones',
editable:true,
queryCaching: false,
queryMode: 'remote',
emptyText: 'Buscar dirección :D',
listWidth: 'auto',
matchFieldWidth: false,
id: 'BuscaDireccion',
valueField: 'Direcciones',
listeners: {
"select": function (combo, record) {
dibujaRol(record.data.rol);
//alert("Estoy arreglando esto :D");
/*busqueda = new OpenLayers.Layer.Vector("WFS", {
strategies: [new OpenLayers.Strategy.BBOX()],
protocol: new OpenLayers.Protocol.WFS({
url: "/geoserver/wfs?service=wfs&version=1.1.0&request=GetFeature&typeName=geonode:urbano&Filter=ROL"+record.data.rol+"",
featureType: "geonode:urbano",
featureNS: "http://www.openplans.org/topp"
}),
styleMap: new OpenLayers.StyleMap({
"default": new OpenLayers.Style(OpenLayers.Util.applyDefaults({
strokeColor: '#4BFFFF',
strokeWidth: 3,
fillOpacity: 0
}, OpenLayers.Feature.Vector.style["default"]))
})
})
map.addLayers([busqueda]);*/
},
"focus": function () {
keyboardnav.deactivate();
Ext.getCmp("BuscaDireccion").setValue('');
},
"blur": function () {
keyboardnav.activate();
}
}
});
var identify = new GeoExt.Action({
id: "identifyButton",
tooltip: "Información",
iconCls: "icon-identify",
toggleGroup: "navigation",
pressed: true,
allowDepress: true,
control: infoCtrl,
map: map,
handler: function () {
if (Ext.getCmp("identifyButton").pressed === true) {
//selectCtrl.activate();
Ext.getCmp("map").body.applyStyles("cursor:help");
var element = document.getElementById("output");
element.innerHTML = "";
layerRuler.removeFeatures(layerRuler.features);
}
else if (Ext.getCmp("identifyButton").pressed === false) {
//selectCtrl.deactivate();
Ext.getCmp("map").body.applyStyles("cursor:default");
var element = document.getElementById("output");
element.innerHTML = "";
layerRuler.removeFeatures(layerRuler.features);
if (popup) {
popup.close();
}
//parcelsHighlight.setVisibility(false);
}
}
});
var printButton = new Ext.Button({
tooltip: "Imprimir vista",
iconCls: "icon-print",
handler: function () {
alert("pronto");
}
});
var Biblioteca = new Ext.Button({
text: "Biblioteca de Mapas",
tooltip: "Biblioteca",
iconCls: "icon-miubicacion",
handler: function () {
window.open("http://ide.emprendequillota.cl");
}
});
var mapLinkButton = new Ext.Button({
text: "Enlace del Mapa",
iconCls: "icon-link",
iconAlign: "right",
handler: function () {
Ext.MessageBox.alert('URL del mapa', 'Haz Click para abrir el link');
}
});
var srsSelector = new Ext.Button({
menu: {
items: [{
text: "Grados Decimales",
checked: true,
group: "srs",
handler: function () {
document.getElementById('ddcoords').style.display = 'inline';
document.getElementById('dmscoords').style.display = 'none';
document.getElementById('spcoords').style.display = 'none';
document.getElementById('utmcoords').style.display = 'none';
srsSelector.setText("Grados Decimales");
}
}, {
text: "Grados Minutos Segundos",
checked: false,
group: "srs",
handler: function () {
document.getElementById('ddcoords').style.display = 'none';
document.getElementById('dmscoords').style.display = 'inline';
document.getElementById('spcoords').style.display = 'none';
document.getElementById('utmcoords').style.display = 'none';
srsSelector.setText("Grados Minutos Segundos");
}
}, {
text: "Grados",
checked: false,
group: "srs",
handler: function () {
document.getElementById('ddcoords').style.display = 'none';
document.getElementById('dmscoords').style.display = 'none';
document.getElementById('spcoords').style.display = 'inline';
document.getElementById('utmcoords').style.display = 'none';
srsSelector.setText("State Plane Feet");
}
}, {
text: "Medición UTM",
checked: false,
group: "srs",
handler: function () {
document.getElementById('ddcoords').style.display = 'none';
document.getElementById('dmscoords').style.display = 'none';
document.getElementById('spcoords').style.display = 'none';
document.getElementById('utmcoords').style.display = 'inline';
srsSelector.setText("UTM Meters");
}
}]
},
//tooltip: "Select a Coordinate System",
text: "Grados Decimales"
});
var fullScreenButton = new Ext.Button({
id: "fullScreenButton",
text: "Pantalla Completa",
iconCls: "icon-fullscreen",
iconAlign: "right",
enableToggle: true,
handler: function () {
if (Ext.getCmp("fullScreenButton").pressed == true) {
// Ext.getCmp("northPanel").collapse();
Ext.getCmp("westPanel").collapse();
}
if (Ext.getCmp("fullScreenButton").pressed == false) {
//Ext.getCmp("northPanel").expand();
Ext.getCmp("westPanel").expand();
}
}
});
// Zoom Out control
var zoomOut = new Ext.Button({
tooltip: "Alejar",
iconCls: "icon-zoomout",
handler: function () {
map.zoomOut();
}
});
// Clear Selection control in the 'navigation' toggleGroup
var clearSelect = new Ext.Button({
tooltip: "Limpiar mapa",
iconCls: "icon-clearselect",
handler: function () {
if (popup) {
popup.close();
}
vectorLayer.removeAllFeatures();
var element = document.getElementById("output");
element.innerHTML = "";
layerRuler.removeFeatures(layerRuler.features);
length.cancel();
area.cancel();
}
});
var zoomIn = new GeoExt.Action({
id: "zoominButton",
tooltip: "Acercar",
iconCls: "icon-zoomin",
toggleGroup: "navigation",
pressed: false,
allowDepress: true,
control: new OpenLayers.Control.ZoomBox({
alwaysZoom: true
}),
map: map,
handler: function () {
if (Ext.getCmp("zoominButton").pressed === true) {
Ext.getCmp("map").body.applyStyles("cursor:crosshair");
var element = document.getElementById("output");
element.innerHTML = "";
layerRuler.removeFeatures(layerRuler.features);
}
else if (Ext.getCmp("zoominButton").pressed === false) {
Ext.getCmp("map").body.applyStyles("cursor:default");
}
}
});
var zoomOut = new Ext.Button({
tooltip: "Alejar",
iconCls: "icon-zoomout",
handler: function () {
map.zoomOut();
}
});
var navHistoryCtrl = new OpenLayers.Control.NavigationHistory();
map.addControl(navHistoryCtrl);
var zoomPrevious = new GeoExt.Action({
tooltip: "Zoom vista previa",
iconCls: "icon-zoomprevious",
control: navHistoryCtrl.previous,
disabled: true
});
var zoomNext = new GeoExt.Action({
tooltip: "Zoom proxima vista",
iconCls: "icon-zoomnext",
control: navHistoryCtrl.next,
disabled: true
});
var zoomExtentBtn = new Ext.Button({
tooltip: "Zoom punto inicial",
iconCls: "icon-zoomextent",
handler: function () {
map.setCenter(mapPanel.initialConfig.center, mapPanel.initialConfig.zoom);
}
});
// Map Navigation control in the 'navigation' toggleGroup
var panZoom = new GeoExt.Action({
tooltip: "Arrastrar",
iconCls: "icon-pan",
toggleGroup: "navigation",
pressed: true,
allowDepress: true,
control: new OpenLayers.Control.Navigation(),
map: map,
handler: function () {
Ext.getCmp("map").body.applyStyles("cursor:default");
var element = document.getElementById("output");
element.innerHTML = "";
layerRuler.removeFeatures(layerRuler.features);
}
});
var miubicacion = new Ext.Button({
id: "miubicacion",
text: "¿Dónde estoy?",
iconCls: "icon-miubicacion",
handler: function() {
// miubicacion
}
});
opacitySlider = new GeoExt.LayerOpacitySlider({
aggressive: true,
width: 100,
isFormField: true,
inverse: true,
plugins: new GeoExt.LayerOpacitySliderTip({
template: "Nivel de Transparencia: {opacity}%
"
})
});
var zoomSlider = new GeoExt.ZoomSlider({
map: map,
aggressive: true,
vertical: true,
height: 100,
plugins: new GeoExt.ZoomSliderTip({
template: "Nivel zoom: {zoom}
Escala: 1 : {scale}
"
})
});
var toolBar = [panZoom, zoomIn, zoomOut, zoomPrevious, zoomNext, zoomExtentBtn, "-", identify, clearSelect, "-", measureButton, "-", printButton, "-", '',Biblioteca,"-", BuscaDireccion,'->',BuscaPredios];
var bottomBar = [mapLinkButton, "-", 'Escala:
', '', "-", srsSelector, " ", '', "->", fullScreenButton];
mapPanel = new GeoExt.MapPanel({
id: "map",
title: "Mapa Interactivo",
iconCls: "icon-interactivemap",
region: "center",
map: map,
tbar: toolBar,
bbar: bottomBar,
center: elcentro,
zoom: 12,
items: [zoomSlider]
});
CuadroCapas = new Ext.tree.TreePanel({
title: "Cartografias",
iconCls: "icon-maplayers",
autoScroll: true,
//tbar: ["->"],
loader: new Ext.tree.TreeLoader({
applyLoader: false
}),
border: false,
rootVisible: false,
enableDD: false,
root: {
nodeType: "async",
children: treeConfig
},
listeners: {
contextmenu: function(node, e) {
if (node && node.layer) {
node.select();
var c = node.getOwnerTree().contextMenu;
c.contextNode = node;
c.showAt(e.getXY())
}
},
click: function (node, e) {
opacitySlider.setLayer(node.layer);
},
scope: this
}
});
var PanelInferior = new Ext.Panel({
region: "south",
title: "Data Table",
html: "south",
iconCls: "icon-table",
split: true,
height: 200,
minSize: 100,
maxSize: 250,
collapseMode: "mini",
collapsed: true,
margins: "0 0 0 0"
});
var Herramientas = new Ext.Panel({
id: "help",
title: "Ayuda",
iconCls: "icon-help",
closable: false,
autoScroll: true,
layout:"fit",
border: true,
//items: [buscaROLRUT],
//html: '