image size depends on screen resolution
Peter H.M. Jacobs
peter42 at dds.nl
Wed Mar 1 13:12:39 PST 2000
Hello Stephen and others,
It works for all the browsers I've tested. These are Microsoft Internet
Explorer and Netscape for both Linux as Windows.
It's in my opinion a very common Java code.
Regards,
Peter
-----Oorspronkelijk bericht-----
Van: Stephen Lime [mailto:steve.lime at dnr.state.mn.us]
Verzonden: woensdag 1 maart 2000 22:03
Aan: peter42 at dds.nl; mapserver-users at lists.gis.umn.edu
Onderwerp: Re: image size depends on screen resolution
Cool. Any idea which browsers and versions of javascript this is limited to
(if any)?
>>> "Peter H.M. Jacobs" <peter42 at dds.nl> 03/01/00 02:59PM >>>
Hello,
I've implemented a very small Java script for creating a mapserv image where
the size depends on the resolution of the screen of the user. I thought that
perhaps some of you might be interested. Just put something like this in the
HTML template
<script language=Javascript>
<!--
if (screen.width==800)
{
var imgsizex=420;
var imgsizey=320;
}
if (screen.width>800)
{
var imgsizex=600;
var imgsizey=480;
}
document.write ('<input type="hidden" name="mapsize"
value="'+imgsizex+' '+imgsizey+'">');
//-->
</script>
Now you've created just another hidden input type that is being send to the
mapserv
Regards,
Peter
More information about the MapServer-users
mailing list