[Mapserver-users] switching layers when zooming

Oliver Wesp wesp at gdv.com
Tue Jan 28 06:15:55 EST 2003


Maybe the identical layer name causes this effect. Maybe it's better to 
use the group option. Should be something like this:

LAYER
NAME relief_highscale
GROUP relief
.
.
.
END

LAYER
NAME relief_lowscale
GROUP relief
.
.
.
END

This way you have unique layer names, but you still can handle it as one 
layer in your application via the group name.

Agneta Schick schrieb:
> 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
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> 
> 
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
> 
> 
> 


-- 
Dipl.-Geogr. Oliver Wesp
Gesellschaft für geografische Datenverarbeitung
Binger Strasse 49-51
D-55218 Ingelheim
fon: +49 6132 714818
fax: +49 6132 714828
http: www.gdv.com




More information about the mapserver-users mailing list