Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I've tried a lot of times to use the OpenLayers CQL example but nothing changes. Is there any way to use CQL or filter.

share|improve this question
    
which example are you trying to use? what goes wrong? –  iant Jan 8 '13 at 10:06
    
Are you using Geoserver? CQL filters don't work with any other WMS service. –  user1702401 Jan 8 '13 at 10:07
    
Yes i m using geoserver and link Also i ve tried to many times . –  Rusty Jan 8 '13 at 10:55
    
works for me - what is your actual problem –  iant Jan 9 '13 at 15:44
    
share your code for people to look at where you might be wrong. –  Aragon Jan 9 '13 at 17:05

2 Answers 2

You have CQL in example:

STATE_ABBR >= 'B' AND STATE_ABBR <= 'O'

Try to change B to A and you will see change

STATE_ABBR >= 'A' AND STATE_ABBR <= 'O'

BTW OpenLayers supports less function then GeoServer but you can read http://docs.geoserver.org/stable/en/user/tutorials/cql/cql_tutorial.html

share|improve this answer

try to use this code:

lyr = new OpenLayers.Layer.WMS(yourLayerName, yourLayerService,{
      'VERSION' : '1.1.0',
      'layers' : yourLayerNum,
      format: 'image/png',
      transparent: true,
      CQL_FILTER: "STATE_ABBR >= 'B' AND STATE_ABBR <= 'O'"

},
      isBaseLayer: false
);

map.addLayer(lyr);

dont forget VERSION is important for getting true result.

i hope it helps you...

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.