image size depends on screen resolution
Peter H.M. Jacobs
peter42 at dds.nl
Wed Mar 1 12:59:48 PST 2000
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