[Chameleon] Map width/height based on clienthWidth/clientHeight
Brent Lund
Brent.Lund at state.mn.us
Fri Jun 16 15:28:52 EDT 2006
Here's what I've done. It's not real clean though (initially loads map
image twice).
function myOnLoad()
{
CWC2OnLoadFunction();
var oImage = CWCDHTML_GetImage( 'mapimage' );
var myWidth = document.body.clientWidth;
var myHeight = document.body.clientHeight;
if (myHeight<500)
myHeight = Math.round(myHeight /2);
else if (myHeight<620)
myHeight = Math.round(myHeight*0.66);
else
myHeight = Math.round(myHeight*0.75);
if (myWidth<800)
myWidth = Math.round(myWidth/2);
else
myWidth = Math.round(myWidth*0.66);
if (!((oImage.width== myWidth) && (oImage.height== myHeight)))
applyMapSize(myWidth,myHeight);
}
......
<cwc2 type="MapSize" visible="false"....
________________________________
From: chameleon-bounces at lists.maptools.org
[mailto:chameleon-bounces at lists.maptools.org] On Behalf Of Brent Lund
Sent: Friday, June 16, 2006 11:57 AM
To: chameleon at lists.maptools.org
Subject: [Chameleon] Map width/height based on clienthWidth/clientHeight
Is there a way to set the map (MapDHTML) width and height based on the
user's document.body.clientWidth (clientHeight)
Thanks,
Brent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/chameleon/attachments/20060616/ac817606/attachment.html
More information about the Chameleon
mailing list