[Mapserver-users] switching layers when zooming

Agneta Schick schick at sdac.hannover.bgr.de
Tue Jan 28 02:51:28 PST 2003


Hello,

As long as I was only using only one layer I thought I knew what I was doing.

Apparently not... I want to show a layer (1:1000000) and after zooming
below 1:250000 switch to a different layer.
My solution is define two layers with the same name but different MINSCALE,
MAXSCALE:
...
LAYER
  NAME relief
  DATA graul0.tif
  TYPE RASTER
  MAXSCALE 5000000
  MINSCALE  250000
  STATUS DEFAULT
END
LAYER
  NAME relief
  TILEINDEX index200.shp
  TILEITEM "dtk200"
  TYPE RASTER
  MAXSCALE 250000
  STATUS DEFAULT
END
...
MapScript:
    my $layer = $map->getLayerByName('relief');
    $layer->draw($map, $img); 

I expected Mapserver to interpret $map->{scale} and show the appropriate
map. My result: after zooming below 250000 my layer is empty.
Each if the two layers are ok as a single layer and I've checked the contents of 
$map->{scale} so that's not the problem.
Is my whole assumption wrong?

Thank you for your help.
Agneta Schick


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Agneta Schick
    
    Bundesanstalt fuer Geowissenschaften und Rohstoffe
    Federal Institute for Geosciences and Natural Resources
    Stilleweg 2
    D- 30655 Hannover                   Tel.: +49 511 643 3136
    GERMANY                             FAX.: +49 511 643 3663

    schick at sdac.hannover.bgr.de         http://www.seismologie.bgr.de
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~






More information about the MapServer-users mailing list