[Chameleon] Resizing MapDHTML widget without submitting
page...possible?
Mike Leahy
mgleahy at alumni.uwaterloo.ca
Tue Nov 8 15:11:59 EST 2005
I just realized I sent both of these earlier replies off-list (sorry
Bart/Jason):
Mike Leahy wrote:
> Hey there,
>
> I should point out first that I've updated the sample, which should
> handle the currently active navigation tool better than my original
> attempt. I've also updated the modified NavTool.php (the first one
> sort-of broke the JSAPI mode, I think the current one should work fine).
>
> As for conversion of widgets, I really haven't done much in the way of
> conversion, and I'm not sure that we have any specific requirements to
> rewrite any more for our work. Chameleon effectively runs like it
> normally does using this ajax method, except whenever the
> document.forms[0].submit event is executed, it loads the application
> through an XMLHttpRequest object instead of in the browser window (see
> ajaxMapContents.js in the sample). The responseText returned by this
> object is more or less the same as the normal page...but of course it's
> only text, and any JavaScript doesn't get executed. So when the
> responseText is received, the appropriate input/javascript values are
> parsed out of the text and applied to the active page in the browser.
> This way, I didn't actually need to change any of the widgets, I just
> had to make sure the appropriate contents were updated in the visible
> page, and make sure that various objects were reset (e.g., hiding the
> zoom-box after it has been drawn, and making sure the appropriate
> navigation tool is still active).
>
> For widgets like the MapSize widget, the alteration of the page (from
> what I can tell) happens during the execution of Chameleon in PHP, which
> requires the page to be reloaded, and also runs some initialization
> somewhere in the JavaScript. If you were to include the MapSize widget,
> and try it out, you'd see that it actually works (i.e., the map image
> returned by drawmap.php will be a different size), but it doesn't resize
> the image in the HTML code and it gets resampled by the browser back to
> the default size.
>
> This is my problem, as when I manually resize the map image, there's
> something keeping the image from extending beyond the initial map
> extents. I'm still holding out for further suggestions, as rewriting
> the MapDHTML widget looks like it'll be a big task.
>
> Mike
>
>
> Bart van den Eijnden wrote:
>> Hi Mike,
>>
>> very nice!! Installation also went quite smooth.
>>
>> Will all widgets which have a JSAPI mode work in this way without
>> needing changes? Or do they need similar changes like you did in
>> Navtool.php?
>>
>> What are your plans for this approach? Which widgets will you need in
>> your app and will you "convert" to this approach?
>>
>> Thanks in advance.
>>
>> Best regards,
>> Bart
Mike Leahy wrote:
> Jason,
>
> I'll agree with you on that point. I was really just hoping I could
> accomplish this without anyone having to rewrite significant portions of
> MapDHTML widget. I'll give it a try though...
>
> Mike
>
>
>
> Jason Fournier wrote:
>> Mike,
>>
>> Very nice! An initial quick thought: As you have mentioned, the
>> MapDHTML widget uses clipping to hide map data that exceeds the boundary
>> of the current extents. This should probably be changed so that the Map
>> is placed in a container div and overflow:hidden is set on the container
>> (let the browser do the work for clipping).
>>
>> Best Regards,
>> Jason
More information about the Chameleon
mailing list