Changeset 5c9feda in observatorio


Ignore:
Timestamp:
Sep 12, 2014, 10:39:57 AM (10 years ago)
Author:
eparedes <eparedes@…>
Branches:
master
Children:
0e21ac5, 24668a6
Parents:
b148601 (diff), a6d1e11 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of https://miv.cenditel.gob.ve/cadenas/scm/git/observatorio

Location:
procesos
Files:
1 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • procesos/apps/geocadena/templates/geocadena.html

    ra7fa829 ra69b3c0  
    7070                                {% endfor %}
    7171                        ];
    72                        
    7372                        /// Crea un diccionario de datos con la información de las conecciones a georeferenciar entre las distintas
    7473                        // Unidades Económicas
     
    171170                    conexiones(conUnit);
    172171                    // Invoca a la función de marcas para georeferenciar a las Unidades Económicas
     172
    173173                    marcas(unitProd);
     174
     175                    //georeferencia_cadena_productiva('', '');
    174176                {% endif %}
    175177
     
    249251                                    border: false,
    250252                                    iconCls: 'leyenda',
    251                                     autoScroll: true
     253                                    autoScroll: true,
     254                    xtype: "gx_legendpanel"
    252255                                };
     256
     257                // Agrega la leyenda de las capas agregadas al mapa
     258                /*var leyenda = new GeoExt.LegendPanel({
     259                    //title: 'Capas',
     260                    title: 'Leyenda',
     261                    layerStore: mapPanel.layers,
     262                    renderTo: "gxleyenda",
     263                    dynamic: true,
     264                    border: false,
     265                    iconCls: 'leyenda',
     266                    autoScroll: true,
     267                });*/
    253268                               
    254269                                // == Crea el formulario de consulta del Sistema de Información Geográfico
  • procesos/apps/geocadena/templates/panel_leyenda.html

    ra7fa829 r63eaf3e  
    1212<!-- Elemento que muestra información de los objetos utilizados en el mapa (leyenda) -->
    1313{% load static from staticfiles %}
    14 <div id="gxleyenda">
    15         <table>
    16                 <col class="colA"><col class="colB">
    17                 <tr>
    18                         <td align="center"><img src='{% static "geocadena/imgs/markers/mark_center.png" %}' width='15px'></td>
    19                         <td align="justify">Unidad Económica Central</td>
    20                 </tr>
    21                 <tr>
    22                         <td align="center"><img src='{% static "geocadena/imgs/markers/mark_up.png" %}' width='15px'></td>
    23                         <td align="justify">Unidades Económicas Aguas Arriba</td>
    24                 </tr>
    25                 <tr>
    26                         <td align="center"><img src='{% static "geocadena/imgs/markers/mark_down.png" %}' width='15px'></td>
    27                         <td align="justify">Unidades Económicas Aguas Abajo</td>
    28                 </tr>
    29                 <tr>
    30                         <td><hr noshade="noshade" size="3" width='30px' style='background:#0000FF'></td>
    31                         <td align="justify">Conexión - U.E. Aguas Arriba</td>
    32                 </tr>
    33                 <tr>
    34                         <td><hr noshade="noshade" size="3" width='30px' style='background:#008000'></td>
    35                         <td align="justify">Conexión - U.E. Aguas Abajo</td>
    36                 </tr>
    37         </table>
    38 </div>
     14<div id="gxleyenda"></div>
  • procesos/apps/geocadena/views.py

    ra7fa829 r5411a89  
    199199        grafo = AGraph(settings.PATH + "/tmp/" + usuario + ".dot")
    200200
    201         nodos = [n for n in grafo.nodes_iter() if n.attr['label'][0] == 'J']
    202 
     201        nodos = [n for n in grafo.nodes_iter() if n.attr['label'][0] in ['J', 'G', 'V', 'E', 'P']]
     202       
    203203        for c in nodos:
     204
    204205            nivel = ""
    205206            rif = grafo.get_node(c).attr['label'][0:10]
     
    207208
    208209            icono = ''
    209 
    210210            if ue:
    211211                if grafo.get_node(c).attr['color'] == 'darkgreen':
    212212                    icono = static('geocadena/imgs/markers/mark_center.png')
    213                     #icono = 'http://www.openlayers.org/dev/img/marker-green.png'
    214213                    nivel = "C"
    215214                elif grafo.get_node(c).attr['color'] == 'yellow':
    216215                    icono = static('geocadena/imgs/markers/mark_down.png')
    217                     #icono = 'http://www.openlayers.org/dev/img/marker-gold.png'
    218216                    nivel = "A"
    219217                elif grafo.get_node(c).attr['color'] == 'dodgerblue':
    220218                    icono = static('geocadena/imgs/markers/mark_up.png')
    221                     #icono = 'http://www.openlayers.org/dev/img/marker-blue.png'
    222219                    nivel = "P"
    223220
     
    258255
    259256                try:
    260                     estado = ue.parroquia.municipio.entidad
    261                     municipio = ue.parroquia.municipio
    262                     parroquia = ue.parroquia
     257                    estado = ue.parroquia.municipio.entidad.nombre
     258                    municipio = ue.parroquia.municipio.nombre
     259                    parroquia = ue.parroquia.nombre
    263260                except AttributeError:
    264261                    estado = ''
     
    269266                consume = ""
    270267                conn = [g for g in grafo.edges() if c in g]
     268
    271269                # Verifica la producción e insumos de las Unidades Económicas
    272270                for cx in conn:
     
    294292                                   'ueparr': parroquia,
    295293                                   'nivel': nivel})
    296     except Exception:
     294    except Exception, e:
    297295        pass
    298296
     
    432430        consultadas
    433431    """
     432    import json
     433   
    434434    return render_to_response('geocadena.html', {'cadena': getNodos(str(request.user)),
    435435                                                 'referencias': getReferencias(str(request.user)),
  • procesos/apps/sigesic/busqueda/forms.py

    r2be26ce rb148601  
    364364                            widget=forms.TextInput(attrs={'title': title_busca, 'size': '130', 'class': 'field text'}))
    365365    title_estado = 'Seleccione el estado'
    366     onchange_estado = "actualizar_combo('/ajax/actualizar_combo', this.value, 'id_municipio', 'comun', 'Municipio', " \
     366    onchange_estado = "actualizar_combo('ajax/actualizar_combo', this.value, 'id_municipio', 'comun', 'Municipio', " \
    367367                      "'entidad', 'codigo', 'nombre', 'default')"
    368368    estado = forms.ChoiceField(choices=cargarEntidades(),
     
    370370                                                          'title': title_estado}))
    371371    title_municipio = 'Seleccione el municipio'
    372     onchange_municipio = "actualizar_combo('/ajax/actualizar_combo', this.value, 'id_parroquia', 'comun', " \
     372    onchange_municipio = "actualizar_combo('ajax/actualizar_combo', this.value, 'id_parroquia', 'comun', " \
    373373                         "'Parroquia', 'municipio', 'codigo', 'nombre', 'default')"
    374374    municipio = forms.ChoiceField(choices=[['0', 'Seleccione...']],
     
    510510class FormularioUbicacionEmpresa(forms.Form):
    511511    title_estadou = 'Seleccione el estado'
    512     onchange_estado = "actualizar_combo('/ajax/actualizar_combo', this.value, 'id_municipiou', 'comun', 'Municipio', " \
     512    onchange_estado = "actualizar_combo('ajax/actualizar_combo', this.value, 'id_municipiou', 'comun', 'Municipio', " \
    513513                      "'entidad', 'codigo', 'nombre', 'default')"
    514514    estadou = forms.ChoiceField(choices=cargarEntidades(), label=title_estadou, required=False,
     
    516516                                                           'title': title_estadou}))
    517517    title_municipiou = 'Seleccione el municipio'
    518     onchange_municipio = "actualizar_combo('/ajax/actualizar_combo', this.value, 'id_parroquiau', 'comun', " \
     518    onchange_municipio = "actualizar_combo('ajax/actualizar_combo', this.value, 'id_parroquiau', 'comun', " \
    519519                         "'Parroquia', 'municipio', 'codigo', 'nombre', 'default')"
    520520    municipiou = forms.ChoiceField(choices=[['0', 'Seleccione...']], label=title_municipiou, required=False,
  • procesos/install.py

    r5b752a5 rc4dfe2b  
    421421
    422422
     423def load_fixtures():
     424    """!
     425    Función que permite cargar datos en la base de datos
     426
     427    @author Ing. Roldan D. Vargas G. rvargas@cenditel.gob.ve
     428    @author Centro Nacional de Desarrollo e Investigación en Tecnologías Libres (CENDITEL) Nodo Mérida
     429    @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a>
     430    @date 11-09-2014
     431    @version 1.0.1
     432    """
     433    apps = ["cadenas", "comun", "geocadena"]
     434
     435    fixtures = {
     436        'cadenas': [
     437            'codigociiu7'
     438        ],
     439        'comun': [
     440            'pais', 'entidad', 'municipio', 'parroquia', 'detalle_direccion', 'profesion', 'sexo'
     441        ],
     442        'geocadena': [
     443            'layer_division_estadal', 'layer_capital_estado', 'layer_division_municipal', 'layer_capital_municipio',
     444            'layer_division_parroquial', 'layer_carretera', 'layer_parque_nacional', 'layer_rio', 'layer_comuna',
     445            'layer_ciudad', 'layer_jerarquia_ciudad', 'layer_centro_poblado',
     446            'layer_area_critica_prioridad_tratamiento', 'layer_area_protectora_obra_publica',
     447            'layer_area_rural_desarrollo_integral', 'layer_area_vocacion_forestal', 'layer_cuerpo_agua',
     448            'layer_eje_desarrollo', 'layer_franja_acuatica_zona_costera', 'layer_franja_terrestre_zona_costera',
     449            'layer_hidrografia', 'layer_limite_maritimo', 'layer_monumento_natural', 'layer_pais_vecino',
     450            'layer_red_policentrica', 'layer_reserva_biosfera', 'layer_reserva_fauna_silvestre',
     451            'layer_reserva_forestal', 'layer_reserva_nacional_hidraulica', 'layer_territorio_nacional',
     452            'layer_tierra_indigena_titulada', 'layer_zona_aprovechamiento_agricola', 'layer_zona_protectora',
     453            'layer_zona_seguridad_fronteriza', 'layer_redi', 'poblacion_economica_activa', 'tasa_desempleo',
     454            'indice_nacional_precios_consumidor'
     455        ]
     456    }
     457
     458    for a in apps:
     459        if a in fixtures:
     460            print "\n%sCargando datos de la applicación [%s], por favor espere...%s\n" % (
     461                color_print('normal', 'Blue'), a, color_print('reset')
     462            )
     463            for fjson in fixtures[a]:
     464                data_loaded = os.system("python manage.py loaddata apps/%s/fixtures/%s.json" % (a, fjson))
     465
     466                if data_loaded == 0:
     467                    print "\n%sFixture %s cargado correctamente...%s\n" % (
     468                        color_print('normal', 'Green'), fjson, color_print('reset')
     469                    )
     470                else:
     471                    print "\n%sError cargado el fixture %s...%s\n" % (
     472                        color_print('normal', 'Red'), fjson, color_print('reset')
     473                    )
     474                    break
     475
     476
    423477def install_menu():
    424478    """!
     
    435489    opcion = "1"
    436490
    437     while opcion != "4":
     491    while opcion != "5":
    438492        #borrar_pantalla()
    439493        print color_print('normal', "Green")
     
    444498        print "| (1) Instalar requerimientos                       |"
    445499        print "| (2) Instalar Base de Datos                        |"
    446         print "| (3) Comprobar requerimientos                      |"
    447         print "| (4) Salir                                         |"
     500        print "| (3) Cargar Datos                                  |"
     501        print "| (4) Comprobar requerimientos                      |"
     502        print "| (5) Salir                                         |"
    448503        print "|                                                   |"
    449504        print "====================================================="
     
    458513            check_dependencias()
    459514        elif opcion == "4":
     515            load_fixtures()
     516        elif opcion == "5":
    460517            print "\n\nUsted ha salido del menú de instalación\n\n"
    461518            sleep(2.5)
  • procesos/media/geocadena/js/formularios.js

    rc6dfef6 ra6d1e11  
    332332            else {
    333333
     334                var defaultStyle = new OpenLayers.Style({
     335                    pointRadius: 5,
     336                    fillColor: "${densidad}",
     337                    fillOpacity: 0.8,
     338                    strokeColor: "#cc6633",
     339                    strokeWidth: 0.8,
     340                    strokeOpacity: 0.8,
     341                    label: "${label}",
     342                    fontSize: "12px",
     343                    fontFamily: "Courier New, monospace",
     344                    fontWeight: "bold",
     345                    labelOutlineColor: "white",
     346                    labelOutlineWidth: 3
     347                });
     348
     349                var selectStyle = new OpenLayers.Style({
     350                    fillColor: "#8aeeef",
     351                    strokeColor: "#32a8a9",
     352                    labelYOffset: 13,
     353                    label: "${label}"
     354                });
     355
     356                var rules = [
     357                    new OpenLayers.Rule({
     358                        title: " 0 -   1 %",
     359                        filter: new OpenLayers.Filter.Comparison({
     360                            type: OpenLayers.Filter.Comparison.EQUAL_TO,
     361                            property: "densidad",
     362                            value: "#FFFFFF"
     363                        }),
     364                        symbolizer: {
     365                            graphicName: "star",
     366                            pointRadius: 5,
     367                            fillColor: "#FFFFFF"
     368                        }
     369                    }),
     370                    new OpenLayers.Rule({
     371                        title: " 1 -   5 %",
     372                        filter: new OpenLayers.Filter.Comparison({
     373                            type: OpenLayers.Filter.Comparison.EQUAL_TO,
     374                            property: "densidad",
     375                            value: "#FFFFE5"
     376                        }),
     377                        symbolizer: {
     378                            graphicName: "star",
     379                            pointRadius: 5,
     380                            fillColor: "#FFFFE5"
     381                        }
     382                    }),
     383                    new OpenLayers.Rule({
     384                        title: " 5 -  10 %",
     385                        filter: new OpenLayers.Filter.Comparison({
     386                            type: OpenLayers.Filter.Comparison.EQUAL_TO,
     387                            property: "densidad",
     388                            value: "#FFF7BB"
     389                        }),
     390                        symbolizer: {
     391                            graphicName: "star",
     392                            pointRadius: 5,
     393                            fillColor: "#FFF7BB"
     394                        }
     395                    }),
     396                    new OpenLayers.Rule({
     397                        title: "10 -  20 %",
     398                        filter: new OpenLayers.Filter.Comparison({
     399                            type: OpenLayers.Filter.Comparison.EQUAL_TO,
     400                            property: "densidad",
     401                            value: "#FEE390"
     402                        }),
     403                        symbolizer: {
     404                            graphicName: "star",
     405                            pointRadius: 5,
     406                            fillColor: "#FEE390"
     407                        }
     408                    }),
     409                    new OpenLayers.Rule({
     410                        title: "20 -  30 %",
     411                        filter: new OpenLayers.Filter.Comparison({
     412                            type: OpenLayers.Filter.Comparison.EQUAL_TO,
     413                            property: "densidad",
     414                            value: "#FEC34E"
     415                        }),
     416                        symbolizer: {
     417                            graphicName: "star",
     418                            pointRadius: 5,
     419                            fillColor: "#FEC34E"
     420                        }
     421                    }),
     422                    new OpenLayers.Rule({
     423                        title: "30 -  50 %",
     424                        filter: new OpenLayers.Filter.Comparison({
     425                            type: OpenLayers.Filter.Comparison.EQUAL_TO,
     426                            property: "densidad",
     427                            value: "#FE9828"
     428                        }),
     429                        symbolizer: {
     430                            graphicName: "star",
     431                            pointRadius: 5,
     432                            fillColor: "#FE9828"
     433                        }
     434                    }),
     435                    new OpenLayers.Rule({
     436                        title: "50 -  70 %",
     437                        filter: new OpenLayers.Filter.Comparison({
     438                            type: OpenLayers.Filter.Comparison.EQUAL_TO,
     439                            property: "densidad",
     440                            value: "#EC6F13"
     441                        }),
     442                        symbolizer: {
     443                            graphicName: "star",
     444                            pointRadius: 5,
     445                            fillColor: "#EC6F13"
     446                        }
     447                    }),
     448                    new OpenLayers.Rule({
     449                        title: "70 -  80 %",
     450                        filter: new OpenLayers.Filter.Comparison({
     451                            type: OpenLayers.Filter.Comparison.EQUAL_TO,
     452                            property: "densidad",
     453                            value: "#CC4B02"
     454                        }),
     455                        symbolizer: {
     456                            graphicName: "star",
     457                            pointRadius: 5,
     458                            fillColor: "#CC4B02"
     459                        }
     460                    }),
     461                    new OpenLayers.Rule({
     462                        title: "80 -  90 %",
     463                        filter: new OpenLayers.Filter.Comparison({
     464                            type: OpenLayers.Filter.Comparison.EQUAL_TO,
     465                            property: "densidad",
     466                            value: "#983304"
     467                        }),
     468                        symbolizer: {
     469                            graphicName: "star",
     470                            pointRadius: 5,
     471                            fillColor: "#983304"
     472                        }
     473                    }),
     474                    new OpenLayers.Rule({
     475                        title: "90 - 100 %",
     476                        filter: new OpenLayers.Filter.Comparison({
     477                            type: OpenLayers.Filter.Comparison.EQUAL_TO,
     478                            property: "densidad",
     479                            value: "#652406"
     480                        }),
     481                        symbolizer: {
     482                            graphicName: "star",
     483                            pointRadius: 5,
     484                            fillColor: "#652406"
     485                        }
     486                    })
     487                ];
     488
     489                defaultStyle.addRules(rules);
     490                selectStyle.addRules(rules);
     491
     492                var styleMap = new OpenLayers.StyleMap({'default': defaultStyle,'select': selectStyle});
     493
    334494                var layer = new OpenLayers.Layer.Vector("indicadores", {
    335495                    projection: "EPSG:4326",
    336                     styleMap: new OpenLayers.StyleMap({
    337                         "default": new OpenLayers.Style({
    338                             pointRadius: 5,
    339                             fillColor: "${densidad}", //#ffcc66
    340                             fillOpacity: 0.8,
    341                             strokeColor: "#cc6633",
    342                             strokeWidth: 0.8,
    343                             strokeOpacity: 0.8,
    344                             label: "${label}",
    345                             fontSize: "12px",
    346                             fontFamily: "Courier New, monospace",
    347                             fontWeight: "bold",
    348                             labelOutlineColor: "white",
    349                             labelOutlineWidth: 3
    350                         }),
    351                         "select": {
    352                             fillColor: "#8aeeef",
    353                             strokeColor: "#32a8a9",
    354                             labelYOffset: 13,
    355                             label: "${label}"
    356                         } //Text entspricht feature.attributes.name
    357                     }),
    358496                    renderOptions: {zIndexing: true},
    359497                    strategies: [new OpenLayers.Strategy.Fixed()],
     
    361499                        url: "/sig/indicador?"+estadisticas.getForm().getValues(true),
    362500                        format: new OpenLayers.Format.GeoJSON()
    363                     })
     501                    }),
     502                    styleMap: styleMap
    364503                });
    365504
  • procesos/media/geocadena/js/funciones.js

    rc6dfef6 ra1c4d59  
    88 * @version 1.0.0
    99 */
     10
     11 /*function georeferencia_cadena_productiva(unitProd, conexiones) {
     12    var point, marks_vector, styleMap;
     13    var selectStyle = new OpenLayers.Style({
     14        fillColor: "#8aeeef",
     15        fillOpacity: 5,
     16        strokeColor: "#8aeeef",
     17        strokeWidth: 1
     18    });
     19
     20    var rules = [
     21        new OpenLayers.Rule({
     22            name: "prueba",
     23            elseFilter: true,
     24            symbolizer: {
     25                graphicName: "star",
     26                pointRadius: 5,
     27                fillColor: "#8aeeef",
     28                strokeColor: "#8aeeef",
     29                strokeWidth: 1
     30            }
     31        })
     32    ];
     33
     34    selectStyle.addRules(rules);
     35   
     36    // Asigna los estilos a utilizar en la capa a ser agregada
     37    styleMap = new OpenLayers.StyleMap({'default': selectStyle,'select': selectStyle});
     38    marks_vector = new OpenLayers.Layer.Vector("Cadena Productiva", {styleMap: styleMap});
     39    mapa.addLayer(marks_vector);
     40   
     41    for (i=0; i<unitProd.length; i++) {
     42        point = new OpenLayers.Geometry.Point(unitProd[i]['lon'],unitProd[i]['lat']).transform(fromProjection, toProjection);
     43        marker = new OpenLayers.Feature.Vector(point, null, {
     44            externalGraphic: unitProd[i]['icono'],
     45            graphicHeight: 20,
     46            graphicWidth: 23,
     47            graphicOpacity: gOpacity
     48        });
     49        marks_vector.addFeatures(marker);
     50    }
     51 }*/
    1052
    1153/**
     
    2062 */
    2163function marcas(unitProd) {
    22         // Define las variables a utilizar en la función
     64    // Define las variables a utilizar en la función
    2365        var mark_uec, mark_uea, mark_uep, marker; // Determina las capas a incorporar en el mapa
    2466        var gOpacity; // gOpacity Determina la opacidad a aplicar en una marca georeferenciada
     
    3375        // emergentes con información de la U.E.
    3476        var listeners = {
    35         eventListeners:{
    36                 // Cuando el objeto es seleccionado
     77            // Cuando el objeto es seleccionado
    3778            'featureselected':function(evt){
    3879                var feature = evt.feature;
     
    4182                var attr = '';
    4283                for (prop in feature.attributes) {
    43                         attr += prop+",";
     84                    attr += prop+",";
    4485                }
    4586                // Permite mostrar ventana emergente en cada marca dentro del mapa
     
    61102                feature.popup = null;
    62103            }
    63         }
    64     };
     104        };
     105
     106    var selectStyle_uec = new OpenLayers.Style({
     107        fillColor: "#8aeeef",
     108        fillOpacity: 5,
     109        strokeColor: "#8aeeef",
     110        strokeWidth: 1
     111    });
     112
     113    var rules_uec = [
     114        new OpenLayers.Rule({
     115            name: "Unidad Económica Consultada",
     116            elseFilter: true,
     117            symbolizer: {
     118                externalGraphic: "../../media/geocadena/imgs/markers/mark_center.png",
     119                pointRadius: 5,
     120                fillColor: "#8aeeef",
     121                strokeColor: "#8aeeef",
     122                strokeWidth: 1
     123            }
     124        })
     125    ];
     126    selectStyle_uec.addRules(rules_uec);
     127    styleMap = new OpenLayers.StyleMap({'default': selectStyle_uec,'select': selectStyle_uec});
    65128       
    66129        // Instrucciones para crear las capas vectoriales a incluír en el mapa
    67         mark_uec = new OpenLayers.Layer.Vector("U.E. Central",listeners);
     130        // Capa de marcador de U.E. Central
     131    mark_uec = new OpenLayers.Layer.Vector("U.E. Central",{styleMap: styleMap, eventListeners: listeners});
    68132    mark_uec.events.on({"loadstart": function() {
    69133        Ext.Msg.wait('Cargando marcador de U.E. Central', 'Espere');
     
    72136        Ext.Msg.hide();
    73137    }});
    74         mapa.addLayer(mark_uec);
    75         mark_uea = new OpenLayers.Layer.Vector("U.E. Aguas Arriba", listeners);
     138    mapa.addLayer(mark_uec);
     139       
     140    var selectStyle_uea = new OpenLayers.Style({
     141        fillColor: "#8aeeef",
     142        fillOpacity: 5,
     143        strokeColor: "#8aeeef",
     144        strokeWidth: 1
     145    });
     146
     147    var rules_uea = [
     148        new OpenLayers.Rule({
     149            name: "Unidades Económicas Proveedoras",
     150            elseFilter: true,
     151            symbolizer: {
     152                externalGraphic: "../../media/geocadena/imgs/markers/mark_up.png",
     153                pointRadius: 5,
     154                fillColor: "#8aeeef",
     155                strokeColor: "#8aeeef",
     156                strokeWidth: 1
     157            }
     158        })
     159    ];
     160    selectStyle_uea.addRules(rules_uea);
     161    styleMap = new OpenLayers.StyleMap({'default': selectStyle_uea,'select': selectStyle_uea});
     162
     163    // Capa de marcador de U.E. Aguas Arriba
     164    mark_uea = new OpenLayers.Layer.Vector("U.E. Aguas Arriba", {styleMap: styleMap, eventListeners: listeners});
    76165    mark_uea.events.on({"loadstart": function() {
    77166        Ext.Msg.wait('Cargando marcadores Aguas Arriba', 'Espere');
     
    81170    }});
    82171        mapa.addLayer(mark_uea);
    83         mark_uep = new OpenLayers.Layer.Vector("U.E. Aguas Abajo", listeners);
     172
     173    var selectStyle_uep = new OpenLayers.Style({
     174        fillColor: "#8aeeef",
     175        fillOpacity: 5,
     176        strokeColor: "#8aeeef",
     177        strokeWidth: 1
     178    });
     179
     180    var rules_uep = [
     181        new OpenLayers.Rule({
     182            name: "Unidades Económicas Clientes",
     183            elseFilter: true,
     184            symbolizer: {
     185                externalGraphic: "../../media/geocadena/imgs/markers/mark_down.png",
     186                pointRadius: 5,
     187                fillColor: "#8aeeef",
     188                strokeColor: "#8aeeef",
     189                strokeWidth: 1
     190            }
     191        })
     192    ];
     193    selectStyle_uep.addRules(rules_uep);
     194    styleMap = new OpenLayers.StyleMap({'default': selectStyle_uep,'select': selectStyle_uep});
     195
     196    // Capa de marcador de U.E. Aguas Abajo
     197        mark_uep = new OpenLayers.Layer.Vector("U.E. Aguas Abajo", {styleMap: styleMap, eventListeners: listeners});
    84198    mark_uep.events.on({"loadstart": function() {
    85199        Ext.Msg.wait('Cargando marcadores Aguas Abajo', 'Espere');
     
    128242                        parroquia:      "<div class='label'>Parroquia</div><div>"+par+"</div>"
    129243                },
    130                 {externalGraphic: unitProd[i]['icono'], graphicHeight: 20, graphicWidth: 23, graphicOpacity: gOpacity}
     244                {
     245                externalGraphic: unitProd[i]['icono'],
     246                graphicHeight: 20,
     247                graphicWidth: 23,
     248                graphicOpacity: gOpacity,
     249                symbolizer: {
     250                    graphicName: "star",
     251                    fillColor: "#0000FF",
     252                    strokeColor: "#0000FF",
     253                    strokeWidth: 2,
     254                }
     255            }
    131256        );
    132257
    133         // Condición que evalúa la posición de la Unidad Económica dentro de la cadena productiva para agregar la marca
     258        // Condición que evalúa la posición de la Unidad Económica dentro de la cadena productiva para agregar la marca
    134259        // a la capa correspondiente
    135260        if (unitProd[i]['nivel']=="C") {
    136                 mark_uec.addFeatures(feature);
    137                 var desc = detalles_ue(mark_uec.features['0']['data']);
     261            mark_uec.addFeatures([feature]);
     262            var desc = detalles_ue(mark_uec.features['0']['data']);
    138263                document.getElementById('gxInfomarks').innerHTML = desc;
    139264                var selector = new OpenLayers.Control.SelectFeature(mark_uec,{
     
    244369        });*/
    245370        var styleA = new OpenLayers.Style();
     371   
    246372        var ruleA = new OpenLayers.Rule({
     373        name: "Insumos",
     374        elseFilter: true,
    247375                symbolizer: {
    248376                        fillColor: "#008000",
    249377                        strokeColor: "#008000",
    250378                        strokeWidth: 2,
    251                         label:"${name}",
    252379                        labelAlign: "cm",
    253380                        labelXOffset: "${xOffset}",
     
    257384        });
    258385        styleA.addRules([ruleA]);
    259         var styleP = new OpenLayers.Style({
     386       
     387    var styleP = new OpenLayers.Style({
    260388                fillColor: "#0000FF",
    261389                strokeColor: "#0000FF",
     
    266394            label:"${name}"}
    267395        });
     396
     397    var ruleP = new OpenLayers.Rule({
     398        name: "Productos",
     399        elseFilter: true,
     400        symbolizer: {
     401            fillColor: "#0000FF",
     402            strokeColor: "#0000FF",
     403            strokeWidth: 2,
     404            labelAlign: "cm",
     405            labelXOffset: "${xOffset}",
     406            labelYOffset: "${yOffset}",
     407            fontSize: 12,
     408        }
     409    });
     410    styleP.addRules([ruleP]);
     411
    268412        connA = new OpenLayers.Layer.Vector("Conexiones Aguas Arriba", {styleMap: new OpenLayers.StyleMap(styleA)});
    269413        mapa.addLayer(connA);
     
    341485        label: label
    342486    });
     487
     488
     489
     490    var rules = [
     491        new OpenLayers.Rule({
     492            name: datos.nombreCapa,
     493            elseFilter: true,
     494            symbolizer: {
     495                graphicName: "star",
     496                pointRadius: 5,
     497                fillColor: fillDefaultColor,
     498                fillOpacity: fillDefaultOpacity,
     499                strokeColor: strokeDefaultColor,
     500                strokeWidth: 1
     501            }
     502        })
     503    ];
     504
     505    defaultStyle.addRules(rules);
     506    selectStyle.addRules(rules);
    343507   
    344508    // Asigna los estilos a utilizar en la capa a ser agregada
     
    348512    var layer = new OpenLayers.Layer.Vector(datos.nombreCapa, {
    349513        projection: "EPSG:4326",
    350         styleMap: styleMap,
    351         renderOptions: {zIndexing: true},
     514        //renderOptions: {zIndexing: true},
    352515        strategies: [new OpenLayers.Strategy.Fixed()],
    353516        protocol: new OpenLayers.Protocol.HTTP({
    354517            url: datos.url_capa,
    355518            format: new OpenLayers.Format.GeoJSON()
    356         })
     519        }),
     520        styleMap: styleMap
    357521    });
    358522
Note: See TracChangeset for help on using the changeset viewer.