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 have a map application using GXP which displays different data coming from different WMS sources. Some geometry is only available on certain zoomlevels (available via MaxScaleDenominator on the GetCapabilities). It should be only possible to select an overlay layer when you are at that minimum zoom level, otherwise it should be disabled. Any idea on how to do this?

share|improve this question
add comment

1 Answer

Try comparing the Map's current resolution (map.getResolution() or layer.getResolution()) to the layer's minimum resolution (wmsLayer.minResolution)

non tested sudo code:

if(map.getResolution() < wmsLayer.minResolution){
     //disable layer selection.
}else{
     //enable layer selection.
}

Update:

Please take a look at this wiki page.

share|improve this answer
add comment

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.