[Chameleon] QuickZoom bug
Paul Spencer
pagameba at magma.ca
Fri Aug 13 07:56:06 EDT 2004
Eric, I have filed bug 617 at www.maptools.org/bugzilla to track this
bug. I tried to add you as a cc to the bug but you are not registered
in bugzilla apparently.
It would be most useful if you could create an account in bugzilla and
enter problems such as this directly in bugzilla, this gives us the best
opportunity to track and fix stuff like this.
One problem with the approach you mention here is that if you move the
selection to the previously selected value after you navigate, then you
can never select it again unless you select something else first. For
instance, if you select PEI, then pan west and PEI stays selected, you
can't select it again. So this generates the same problem as you have
noted with the first element in the list.
The way to handle this in the widget is to make the first view tag a
static entry, as in:
<view name="Select a location"/>
This way, when you first select a quickzoom location, it will navigate
to it and set the selection to that entry. On subsequent pages, it will
reset to the first element in the list, in this case the "Select a
location" entry, which allows you to pick any of the quick zoom locations.
The best enhancement would be to have the widget detect that the current
extents match the extents for a particular view and set that view as
selected ... this would require a lot of processing and would probably
require a buffer operation to provide a small tolerance to the selection
A compromise would be for the widget to remember the last set of extents
that it used and keep the selection as long as those extents don't
change. This would mean that you would zoom to PEI and then could
change layer visibility etc and PEI would stay selected in the list. As
soon as you navigate away from those exact extents, then it would reset
the list to the first entry ...
I've put a copy of this in the bug.
Comments and suggestions welcome.
Cheers,
Paul
Eric Bridger wrote:
> I noticed a bug in the QuickZoom widget (Chameleon 1.99 beta 1 and 2).
>
> The current selection: SEL_QUICKZOOM hidden variable was not getting
> set, after the first submit, i.e. it was not sticky. So if you quick
> zoom, then pan, you lose the previous selection and wind up with the
> first choice in your select list selected. A minor problem since you
> can then not select the first choice (it's an onChange event).
>
> The problem is in the
>
> GetHTMLHiddenVariables() function. The current value of SEL_QUICKZOOM
> is not retrieved and reset.
>
> This fix to widgets/QuickZoom.widget.php:
>
> function GetHTMLHiddenVariables()
> {
> parent::GetHTMLHiddenVariables();
>
> $szVariable = "NAV_QUICKZOOM";
> $szValue = " <INPUT TYPE=HIDDEN NAME=$szVariable VALUE=\"\">\n";
> $aReturn[$szVariable] = $szValue;
>
> $szVariable = "SEL_QUICKZOOM";
> + $szVal = "";
> + if ($this->isVarSet( $szVariable ))
> + $szVal = $this->getVar( $szVariable );
> + $szValue = " <INPUT TYPE=HIDDEN NAME=$szVariable
> VALUE=\"$szVal\">\n";
> $aReturn[$szVariable] = $szValue;
>
> return $aReturn;
> }
>
> This seems to fix the problem. But I'm not sure if this is the correct
> way to fix it, or how to ensure that this fix get's into a future
> release.
>
>
> Eric
>
>
>
>
>
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon
>
--
-----------------------------------------------------------------
|Paul Spencer pspencer at dmsolutions.ca |
|-----------------------------------------------------------------|
|Applications & Software Development |
|DM Solutions Group Inc http://www.dmsolutions.ca/|
-----------------------------------------------------------------
More information about the Chameleon
mailing list