Changeset 5c9feda in observatorio
- Timestamp:
- Sep 12, 2014, 10:39:57 AM (10 years ago)
- 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. - Location:
- procesos
- Files:
-
- 1 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
procesos/apps/geocadena/templates/geocadena.html
ra7fa829 ra69b3c0 70 70 {% endfor %} 71 71 ]; 72 73 72 /// Crea un diccionario de datos con la información de las conecciones a georeferenciar entre las distintas 74 73 // Unidades Económicas … … 171 170 conexiones(conUnit); 172 171 // Invoca a la función de marcas para georeferenciar a las Unidades Económicas 172 173 173 marcas(unitProd); 174 175 //georeferencia_cadena_productiva('', ''); 174 176 {% endif %} 175 177 … … 249 251 border: false, 250 252 iconCls: 'leyenda', 251 autoScroll: true 253 autoScroll: true, 254 xtype: "gx_legendpanel" 252 255 }; 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 });*/ 253 268 254 269 // == Crea el formulario de consulta del Sistema de Información Geográfico -
procesos/apps/geocadena/templates/panel_leyenda.html
ra7fa829 r63eaf3e 12 12 <!-- Elemento que muestra información de los objetos utilizados en el mapa (leyenda) --> 13 13 {% 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 199 199 grafo = AGraph(settings.PATH + "/tmp/" + usuario + ".dot") 200 200 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 203 203 for c in nodos: 204 204 205 nivel = "" 205 206 rif = grafo.get_node(c).attr['label'][0:10] … … 207 208 208 209 icono = '' 209 210 210 if ue: 211 211 if grafo.get_node(c).attr['color'] == 'darkgreen': 212 212 icono = static('geocadena/imgs/markers/mark_center.png') 213 #icono = 'http://www.openlayers.org/dev/img/marker-green.png'214 213 nivel = "C" 215 214 elif grafo.get_node(c).attr['color'] == 'yellow': 216 215 icono = static('geocadena/imgs/markers/mark_down.png') 217 #icono = 'http://www.openlayers.org/dev/img/marker-gold.png'218 216 nivel = "A" 219 217 elif grafo.get_node(c).attr['color'] == 'dodgerblue': 220 218 icono = static('geocadena/imgs/markers/mark_up.png') 221 #icono = 'http://www.openlayers.org/dev/img/marker-blue.png'222 219 nivel = "P" 223 220 … … 258 255 259 256 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 263 260 except AttributeError: 264 261 estado = '' … … 269 266 consume = "" 270 267 conn = [g for g in grafo.edges() if c in g] 268 271 269 # Verifica la producción e insumos de las Unidades Económicas 272 270 for cx in conn: … … 294 292 'ueparr': parroquia, 295 293 'nivel': nivel}) 296 except Exception :294 except Exception, e: 297 295 pass 298 296 … … 432 430 consultadas 433 431 """ 432 import json 433 434 434 return render_to_response('geocadena.html', {'cadena': getNodos(str(request.user)), 435 435 'referencias': getReferencias(str(request.user)), -
procesos/apps/sigesic/busqueda/forms.py
r2be26ce rb148601 364 364 widget=forms.TextInput(attrs={'title': title_busca, 'size': '130', 'class': 'field text'})) 365 365 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', " \ 367 367 "'entidad', 'codigo', 'nombre', 'default')" 368 368 estado = forms.ChoiceField(choices=cargarEntidades(), … … 370 370 'title': title_estado})) 371 371 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', " \ 373 373 "'Parroquia', 'municipio', 'codigo', 'nombre', 'default')" 374 374 municipio = forms.ChoiceField(choices=[['0', 'Seleccione...']], … … 510 510 class FormularioUbicacionEmpresa(forms.Form): 511 511 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', " \ 513 513 "'entidad', 'codigo', 'nombre', 'default')" 514 514 estadou = forms.ChoiceField(choices=cargarEntidades(), label=title_estadou, required=False, … … 516 516 'title': title_estadou})) 517 517 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', " \ 519 519 "'Parroquia', 'municipio', 'codigo', 'nombre', 'default')" 520 520 municipiou = forms.ChoiceField(choices=[['0', 'Seleccione...']], label=title_municipiou, required=False, -
procesos/install.py
r5b752a5 rc4dfe2b 421 421 422 422 423 def 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 423 477 def install_menu(): 424 478 """! … … 435 489 opcion = "1" 436 490 437 while opcion != " 4":491 while opcion != "5": 438 492 #borrar_pantalla() 439 493 print color_print('normal', "Green") … … 444 498 print "| (1) Instalar requerimientos |" 445 499 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 |" 448 503 print "| |" 449 504 print "=====================================================" … … 458 513 check_dependencias() 459 514 elif opcion == "4": 515 load_fixtures() 516 elif opcion == "5": 460 517 print "\n\nUsted ha salido del menú de instalación\n\n" 461 518 sleep(2.5) -
procesos/media/geocadena/js/formularios.js
rc6dfef6 ra6d1e11 332 332 else { 333 333 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 334 494 var layer = new OpenLayers.Layer.Vector("indicadores", { 335 495 projection: "EPSG:4326", 336 styleMap: new OpenLayers.StyleMap({337 "default": new OpenLayers.Style({338 pointRadius: 5,339 fillColor: "${densidad}", //#ffcc66340 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: 3350 }),351 "select": {352 fillColor: "#8aeeef",353 strokeColor: "#32a8a9",354 labelYOffset: 13,355 label: "${label}"356 } //Text entspricht feature.attributes.name357 }),358 496 renderOptions: {zIndexing: true}, 359 497 strategies: [new OpenLayers.Strategy.Fixed()], … … 361 499 url: "/sig/indicador?"+estadisticas.getForm().getValues(true), 362 500 format: new OpenLayers.Format.GeoJSON() 363 }) 501 }), 502 styleMap: styleMap 364 503 }); 365 504 -
procesos/media/geocadena/js/funciones.js
rc6dfef6 ra1c4d59 8 8 * @version 1.0.0 9 9 */ 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 }*/ 10 52 11 53 /** … … 20 62 */ 21 63 function marcas(unitProd) { 22 64 // Define las variables a utilizar en la función 23 65 var mark_uec, mark_uea, mark_uep, marker; // Determina las capas a incorporar en el mapa 24 66 var gOpacity; // gOpacity Determina la opacidad a aplicar en una marca georeferenciada … … 33 75 // emergentes con información de la U.E. 34 76 var listeners = { 35 eventListeners:{ 36 // Cuando el objeto es seleccionado 77 // Cuando el objeto es seleccionado 37 78 'featureselected':function(evt){ 38 79 var feature = evt.feature; … … 41 82 var attr = ''; 42 83 for (prop in feature.attributes) { 43 84 attr += prop+","; 44 85 } 45 86 // Permite mostrar ventana emergente en cada marca dentro del mapa … … 61 102 feature.popup = null; 62 103 } 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}); 65 128 66 129 // 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}); 68 132 mark_uec.events.on({"loadstart": function() { 69 133 Ext.Msg.wait('Cargando marcador de U.E. Central', 'Espere'); … … 72 136 Ext.Msg.hide(); 73 137 }}); 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}); 76 165 mark_uea.events.on({"loadstart": function() { 77 166 Ext.Msg.wait('Cargando marcadores Aguas Arriba', 'Espere'); … … 81 170 }}); 82 171 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}); 84 198 mark_uep.events.on({"loadstart": function() { 85 199 Ext.Msg.wait('Cargando marcadores Aguas Abajo', 'Espere'); … … 128 242 parroquia: "<div class='label'>Parroquia</div><div>"+par+"</div>" 129 243 }, 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 } 131 256 ); 132 257 133 258 // Condición que evalúa la posición de la Unidad Económica dentro de la cadena productiva para agregar la marca 134 259 // a la capa correspondiente 135 260 if (unitProd[i]['nivel']=="C") { 136 mark_uec.addFeatures(feature);137 261 mark_uec.addFeatures([feature]); 262 var desc = detalles_ue(mark_uec.features['0']['data']); 138 263 document.getElementById('gxInfomarks').innerHTML = desc; 139 264 var selector = new OpenLayers.Control.SelectFeature(mark_uec,{ … … 244 369 });*/ 245 370 var styleA = new OpenLayers.Style(); 371 246 372 var ruleA = new OpenLayers.Rule({ 373 name: "Insumos", 374 elseFilter: true, 247 375 symbolizer: { 248 376 fillColor: "#008000", 249 377 strokeColor: "#008000", 250 378 strokeWidth: 2, 251 label:"${name}",252 379 labelAlign: "cm", 253 380 labelXOffset: "${xOffset}", … … 257 384 }); 258 385 styleA.addRules([ruleA]); 259 var styleP = new OpenLayers.Style({ 386 387 var styleP = new OpenLayers.Style({ 260 388 fillColor: "#0000FF", 261 389 strokeColor: "#0000FF", … … 266 394 label:"${name}"} 267 395 }); 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 268 412 connA = new OpenLayers.Layer.Vector("Conexiones Aguas Arriba", {styleMap: new OpenLayers.StyleMap(styleA)}); 269 413 mapa.addLayer(connA); … … 341 485 label: label 342 486 }); 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); 343 507 344 508 // Asigna los estilos a utilizar en la capa a ser agregada … … 348 512 var layer = new OpenLayers.Layer.Vector(datos.nombreCapa, { 349 513 projection: "EPSG:4326", 350 styleMap: styleMap, 351 renderOptions: {zIndexing: true}, 514 //renderOptions: {zIndexing: true}, 352 515 strategies: [new OpenLayers.Strategy.Fixed()], 353 516 protocol: new OpenLayers.Protocol.HTTP({ 354 517 url: datos.url_capa, 355 518 format: new OpenLayers.Format.GeoJSON() 356 }) 519 }), 520 styleMap: styleMap 357 521 }); 358 522
Note: See TracChangeset
for help on using the changeset viewer.