image size depends on screen resolution
Stephen Lime
steve.lime at dnr.state.mn.us
Wed Mar 1 13:03:07 PST 2000
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