[mapserver-users] scale dependent layers

Hankley, Chip Chip.Hankley at GASAI.Com
Wed Sep 11 12:29:44 EDT 2002


Rob...

What about using JavaScript and DHTML to hide / show a DIV element?
Basically, you could capture scale as a JS variable:

  <script>
    scale = [scale]
  </script>

and put your legend entries in separate DIVs:

  <div id="lyrRoads"><input type="checkbox"...>Roads Layer</div>

If you play around, you can probably figure out a way to do that...You could
also (conceivably) generate your legend / layer list using JS to write out
the HTML dynamically.

The downside to this, of course, is that the JS / DOM implementation across
browsers is very inconsistent (MHO).

FWIW, this is what makes MapScript nice. Since you are dynamically
generating content, you can simply choose not to write out that part of your
legend / layer list:

  if (scale > layer_max_scale) {
    don't put this line in
  }
  else {
    make an entry
  }

chip

-----Original Message-----
From: Rob Holloway [mailto:rholloway_1999 at yahoo.com]
Sent: Wednesday, September 11, 2002 10:34 AM
To: mapserver-users at lists.gis.umn.edu
Subject: [mapserver-users] scale dependent layers


Hi

Does anyone know how to keep scale dependent layers
(i.e layers with a maxscale set) from displaying on
the template/html form until the specified scale has
been reached?  For example, in my application a
buildings layer has a maxscale factor of 100 000 but
it still shows up in the list of layers that can be
displayed at full extent.  This would probably be
confusing to users trying to select that layer at
large scale.  Any suggestions?

Cheers

Rob

__________________________________________________
Yahoo! - We Remember
9-11: A tribute to the more than 3,000 lives lost
http://dir.remember.yahoo.com/tribute



More information about the mapserver-users mailing list