[Mapserver-users] switching layers when zooming

Martin, Daniel DMartin at erac.com
Tue Jan 28 10:41:40 EST 2003


I can assure you using the same name isn't the problem.  I use this
technique (same name, different scales) in nearly all my maps.  It works
beautifully, especially since they turn on and off together and don't show
up twice in the legend if you filter out-of-scale layers.

But, I must admit I don't know what's going wrong for Agneta.  I've never
used rasters in that manner, and I've never used STATUS DEFAULT on one of
these layers.

-Dan

> -----Original Message-----
> From: Oliver Wesp [mailto:wesp at gdv.com]
> Sent: Tuesday, January 28, 2003 5:16 AM
> To: Agneta Schick
> Cc: mapserver-users at lists.gis.umn.edu
> Subject: Re: [Mapserver-users] switching layers when zooming
> 
> 
> 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
> 
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
> 




More information about the mapserver-users mailing list