[Chameleon] Re: mapsize and jsapi

Liz Godwin godwin.liz at gmail.com
Mon Feb 5 14:04:10 EST 2007


it seems the test of this message was ommitted in the posting that
come through. I'm resending the text portion only (see below) as plain
text.  If you have a problem with the attachments and want them,
please contact me directly.

Cheers,

Liz

> Hello list,
>
> I've had a couple of requests about how we made the map resize automatically
> with a window resize in our applications
> see http://nlwis-snite1.agr.gc.ca/eco/ for an example
> application.
>
> I agree it could be written a bit better - but I don't have a lot of time
> for doing that before posting, so instead I will pass off what I hope is all
> the files I affected for this functionality.  I've included a template file
> with css and js files that create a wireframe of the application with only
> MapDHTML and CompassPoint Widgets.  I've also included the snippits from the
> cwcjsapi.js and UpdateMap.php that I added.  The snippit in cwcjsapi is a
> function, so it's no important where exactly it goes in the file.  the
> snippit in UpdateMap should happen just before the $oMapSession->saveState()
> line (~ 750 something).
>
> The positioning of these elements is done first with CSS and then the
> resizing is done with JavaScript.  The positioning is relative to adjacent
> components, so leaving the wireframe in helps to see how that is done.
>
> Really the javascript should be with the widget and not separate like I have
> it.  I started out having it separate and havn't had a chance to move it in.
>  When something works, it's hard to start breaking it ;-)
>
> Feel free to run with the code - if you make improvements, I wouldn't mind
> hearing about them.  Also, please don't hesitate to post folllow up
> questions.  I did this assembling in haste and i might have missed something
> or not it explained it well enough.
>
> Cheers,
>
> Liz Godwin
>
>


More information about the Chameleon mailing list