[OpenLayers-Users] Error implement Style and Rules in WMSopenlayer

fsalas fsalas at geocuba.cu
Wed Sep 9 15:21:55 EDT 2009


Chris, I have Openlayer 2.7 Now , The error  disappear, but  when I execute 
my function
don´t show the layer

function FiltrarCapa()
 {
       var estilo = new OpenLayers.Style();
      var regla = new OpenLayers.Rule({
     filter: new OpenLayers.Filter.Comparison({
         type: OpenLayers.Filter.Comparison.EQUAL_TO,
         property: "tipo",
         value: 'FV'
      }),
     symbolizer: {pointRadius: 10, fillColor:"green",
     fillOpacity: 0.5,strokeColor: "black"}
   });
   estilo.addRules([regla]);
   map.layers[2].params.STYLES = estilo;
   map.layers[2].redraw();
       }

What is wrong, how resolve this problems.

Salas

----- Original Message ----- 
From: "Christopher Schmidt" <crschmidt at metacarta.com>
To: "fsalas" <fsalas at geocuba.cu>
Cc: <users at openlayers.org>
Sent: Wednesday, September 09, 2009 11:39 AM
Subject: Re: [OpenLayers-Users] Error implement Style and Rules in 
WMSopenlayer


> On Wed, Sep 09, 2009 at 12:17:26PM -0500, fsalas wrote:
>>
>> Hi, I like to make one filter using Openlayer Rule, and after that at 
>> result
>> changed the style
>> But when I try to execute,  show this error "Openlayer.Style Is not a
>> constructor "
>> My Openlayer version is 2.5
>
>  "Don't do that."
>
> Styles and Rules were added in OpenLayers 2.7.
>
> -- Chris
>
>>  var estilo = new OpenLayers.Style();
>>
>>    var regla = new OpenLayers.Rule({
>>      filter: new OpenLayers.Filter.Comparison({
>>          type: OpenLayers.Filter.Comparison.EQUAL_TO,
>>          property: "tipo",
>>          value: 'FV',
>>       }),
>>    symbolizer: {pointRadius: 10, fillColor: "green",
>>                fillOpacity: 0.5, strokeColor: "black"}   });
>>
>>    estilo.addRules([regla]);
>>
>>      Sennales = new OpenLayers.Layer.WMS(
>>      "Señales","http://urano:3128/geoserver/wms",
>>      {
>>       layers: 'topp:sennal',
>>       srs: 'EPSG:4267',
>>       height: '557',
>>       styles: estilo,
>>       transparent: 'true',
>>       format: 'image/png'
>>      },
>>      {
>>         buffer: 0
>>      }
>>     );
>>
>> Best , Regards
>> Salas
>>
>>
>>
>>
>>
>> ___________________________________
>> Dirección de Comunicaciones
>> Grupo Empresarial GEOCUBA
>> Este mensaje esta libre de virus.
>> Revisado por Kaspersky Antivirus
>> ----------------------------------------------------------------------
>> Definition count:  2513853
>> Definition date:  9/9/2009
>> SecurityPlus version: 3.0.5
>>
>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at openlayers.org
>> http://openlayers.org/mailman/listinfo/users
>
> -- 
> Christopher Schmidt
> MetaCarta
> 


___________________________________
Dirección de Comunicaciones
Grupo Empresarial GEOCUBA
Este mensaje esta libre de virus. 
Revisado por Kaspersky Antivirus
----------------------------------------------------------------------
Definition count:  2513853
Definition date:  9/9/2009
SecurityPlus version: 3.0.5






More information about the Users mailing list