An embedded scale bar is just not going to work with an OpenLayers type of interface. (unless, I guess, you use the single, non-tiled layer type in OpenLayers. But then you aren't going to get the cool Googley Goodness slippy map effect. http://www.openlayers.org/dev/examples/mapserver_untiled.html )
The problem is that OpenLayers splits your map window request up in to little tiles. This allows it to easily add more tiles outside of your map window, giving that seamless appearance. When OpenLayers requests all of the tiles for your map, each tile is an individual call to MapServer and your MapServer doesn't know that all of these request are related, they are just requests. So, if you have an embeded scalebar or legend, it will show up in each tile. If you are using OpenLayers, there might be a way to place a legend graphic on top of your map, kind of like the overview map. http://www.openlayers.org/dev/examples/overviewmap.html Otherwise, you may just want to have a spot outside of the map div where you show a legend. David. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Monday, April 14, 2008 11:20 AM To: [email protected]; Emilio Ponce Subject: Re: [mapserver-users] Mapserver + Openlayers legend problem I have the same issue in openlayer + mapserver cgi. However, if I use mapscript without openlayer, then it works fine. --- On Mon, 4/14/08, Emilio Ponce <[EMAIL PROTECTED]> wrote: > From: Emilio Ponce <[EMAIL PROTECTED]> > Subject: [mapserver-users] Mapserver + Openlayers legend problem > To: [email protected] > Date: Monday, April 14, 2008, 10:17 AM > Hi everyone, > > I'm beggining with mapserver + openlayers. > The problem is that I cannot show a legend of my layers, because if I > use the 'LEGEND keyword' into the mapfile, the legend > is shown on every tile of > the openlayers's map. > I've found the same problem for the SCALEBAR. > > The definition of the LEGEND in the mapfile is simple: > > LEGEND > STATUS EMBED > POSITION LR > TRANSPARENT TRUE > END > > And you can see the problem here: > http://www.ietcat.org/htmls04/cat/PDF_PTMB/legend_problem.gif > > Does anyone know how to solve this repetition problem? > > Thanks a lot! > > > > > -- > Emilio_______________________________________________ > mapserver-users mailing list > [email protected] > http://lists.osgeo.org/mailman/listinfo/mapserver-users ________________________________________________________________________ ____________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ _______________________________________________ mapserver-users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/mapserver-users _______________________________________________ mapserver-users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/mapserver-users
