[mapserver-users] scroll out of map-extent

Martin, Daniel DMartin at erac.com
Thu Oct 24 15:59:50 EDT 2002


As Steve says, I don't think you can do this server side.  But, since you
are using Rosa, I think you could do this client side.  Using JavaScript,
you can validate "yourForm.imgxy" against [mapext] before you submit it, and
alter it if it is outside the bounds.  Something like this might work:

myImgxy = yourForm.imgxy;
imgxySplit = myImgxy.split(' ');
mapext = '[mapext]';
mapextSplit = mapext.split(' ');


if (imgxySplit[0] < mapextSplit[0]) {
   longOffSet =  mapextSplit[0] - imgxySplit[0];
   imgxySplit[0] = mapextSplit[0];
   imgxySplit[2] = imgxySplit[2] - longOffSet;
}

.... Repeat for the other three edges, and recombine.

This is straight out of my head, so your mileage may vary.  I've never tried
to do it myself.  If the code doesn't make sense, let me know and I'll try
to clarify.

-Dan



> -----Original Message-----
> From: Steve Lime [mailto:steve.lime at dnr.state.mn.us]
> Sent: Thursday, October 24, 2002 10:47 AM
> To: bjoern at lih.rwth-aachen.de; mapserver-users at lists.gis.umn.edu
> Subject: Re: [mapserver-users] scroll out of map-extent
> 
> 
> There's no way to do it automatically unless you're using mapscript.
> This is a planned feature of 3.7. You'll be able to define a limiting
> extent in your web object...
> 
> Steve
> 
> Stephen Lime
> Data & Applications Manager
> 
> Minnesota DNR
> 500 Lafayette Road
> St. Paul, MN 55155
> 651-297-2937
> 
> >>> <bjoern at lih.rwth-aachen.de> 10/24/02 04:26AM >>>
> Hi all,
> what can I do to force mapserver just to show what's within the 
> mapextent? 
> The problem is that the user may scroll out of the map.
> 
> I use mapserver 3.62 and rosa-applet
> 
> Just setting the extent doesn't solve the problem
> -here is the map section of my map file.
> 
> MAP
>   STATUS ON      
>   EXTENT -180 -90 180 90 
>   SIZE 600 350 
>   SHAPEPATH "data"
>   SYMBOLSET "./etc/symbols.sym"
>   FONTSET "./etc/fonts.txt"
>   IMAGECOLOR 255 255 255
>   TRANSPARENT OFF
>   UNITS DD
>   INTERLACE ON
>   IMAGETYPE GIF
>   IMAGEQUALITY 75
> 
> Any ideas or examples?
> 
> Thanks in advance 
> Björn 
> 
> 
> 
> 
> 




More information about the mapserver-users mailing list