[Chameleon] Not usual "update" widget behaviour while updating map - fixed

Paul Spencer pspencer at dmsolutions.ca
Tue Jan 25 08:02:13 EST 2005


Jacob,Giuseppe ...

we are not yet making active use of the cwcjsapi so its actually not 
suprising that this slipped through the cracks at this end.  Thanks for 
the info, I'll apply this patch to UpdateMap.php in the 2.1 cvs and in 
the 2.0 branch cvs.  To make this not produce javascript errors in 
non-jsapi mode, I've added:

if ({$bCWCJSAPI})
     {
         {$this->mszHTMLForm}.MAP_EXTENTS_MINX.value = 
goCWCJSAPI.oMap.minx;
         {$this->mszHTMLForm}.MAP_EXTENTS_MAXX.value = goCWCJSAPI.oMap.maxx;
         {$this->mszHTMLForm}.MAP_EXTENTS_MINY.value = goCWCJSAPI.oMap.miny;
         {$this->mszHTMLForm}.MAP_EXTENTS_MAXY.value = goCWCJSAPI.oMap.maxy;
         {$this->mszHTMLForm}.NAV_CMD.value = "";
     }

where $bCWCJSAPI is calculated in PHP as:

$bCWCJSAPI = (isset($this->maSharedResourceWidgets["CWCJSAPI"])) ? 1 : 0;

Cheers,

Paul

Jacob Delfos wrote:
> Giuseppe,
>  
> That problem has been there for a while. I once fixed it in my own site 
> in version 1.0.4 when I did some debugging, but I never submitted a bug 
> for it. Paul, does a bug exist for it? I didn't find one, but it seemed 
> so obvious that I can't imagine no one else noticed in all that time.
>  
> This is what needs to be done:
> in UpdateMap.widget.php, line 137, inside the body of the function 
> "clickUpdateMap", the following lines should be added:
>  
> ------------------------------------------------------------------------------------------------------------------------
>     {$this->mszHTMLForm}.MAP_EXTENTS_MINX.value = goCWCJSAPI.oMap.minx;  
> //custom added, not to lose extents
>     {$this->mszHTMLForm}.MAP_EXTENTS_MAXX.value = goCWCJSAPI.oMap.maxx;
>     {$this->mszHTMLForm}.MAP_EXTENTS_MINY.value = goCWCJSAPI.oMap.miny;
>     {$this->mszHTMLForm}.MAP_EXTENTS_MAXY.value = goCWCJSAPI.oMap.maxy;
>     {$this->mszHTMLForm}.NAV_CMD.value = ""
> ------------------------------------------------------------------------------------------------------------------------
>  
>  
> before the line
> ------------------------------------------------------------------------------------------------------------------------
>  {$this->mszHTMLForm}.UPDATE_MAP.value = "1";
> ------------------------------------------------------------------------------------------------------------------------
>  
> This makes sure that whatever was changed in javascript gets saved 
> before it's submitted.
>  
> regards,
>  
> Jacob
>  
>  
>  
>  
>  
> -----Original Message-----
> From: chameleon-bounces at lists.maptools.org 
> <mailto:chameleon-bounces at lists.maptools.org> 
> [mailto:chameleon-bounces at lists.maptools.org] On Behalf Of Giuseppe Tradigo
> Sent: 24 January 2005 00:58
> To: chameleon at lists.maptools.org <mailto:chameleon at lists.maptools.org>
> Subject: [Chameleon] Not usual "update" widget behaviour while updating map
>  
> 
> By activating JS-API using the following tags in the template file:
>  
> <cwc2 type="cwcjsapi" debug="false"/>
> <cwc2 type="SharedResource" name="CWCJSAPI"/>
>  
> the "update" widget has a reproducible wrong behaviour: using the zoom
> widget a couple of times over the map and then clicking update (wether
> or not changing the visible layers) will cause the map-view beeing reset
> to the center of the map.
>  
> ----------------------------------------
> Debugging is twice as hard as writing the code in the first place.
> Therefore, if you write the code as cleverly as possible, you are, by
> definition, not smart enough to debug it.
>     - Brian W. Kernighan
>  
> -- 
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.300 / Virus Database: 265.7.2 - Release Date: 21/01/2005
>  
>  
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org <mailto:Chameleon at lists.maptools.org>
> http://lists.maptools.org/mailman/listinfo/chameleon
>  
>  
>  
> JACOB DELFOS
> SPATIAL INFORMATION ANALYST
> Maunsell Australia Pty Ltd
> 629 Newcastle Street, WA 6007
> PO Box 81, WA 6902
> Leederville
> Western Australia
> ABN 20 093 846 925
>  
> Tel     + 61 8 9281 6185
> Fax    + 61 8 9281 6297
> jacob.delfos at maunsell.com <mailto:jacob.delfos at maunsell.com>
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> 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