Bug 759 - [Chameleon-Widget]ZoomSelectedLayers widget is not zooming to selected layers
: [Chameleon-Widget]ZoomSelectedLayers widget is not zooming to selected layers
Status: RESOLVED FIXED
: Chameleon
Widget
: 1.99
: PC Linux
: P2 normal
: 1.99 beta 4
Assigned To:
:
:
:
:
:
  Show dependency treegraph
 
Reported: 2004-10-24 19:17 by
Modified: 2007-09-24 09:09 (History)


Attachments
sample data for testing zoomselectedlayers (438 bytes, application/octet-stream)
2004-11-04 14:29, Paul Spencer
Details
smallpark.tgz-Compress tar file to test "ZoomSelectedLayer" (1.18 KB, application/octet-stream)
2004-11-10 15:35, Normand Savard
Details


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2004-10-24 19:17:02
ZoomSelectedLayers widget is not zooming to the extents of the selected layers.
 It is acting as a redraw.  I tested it using the "sample_enhanced.phtml"
application.

Fedora Core 2
Chameleon beta 3 20041022
------- Comment #1 From 2004-10-25 09:16:11 -------
Changed target to 1.99 RC 1.
------- Comment #2 From 2004-10-29 10:57:34 -------
Chris, could you explain me what the "ZoomSelectedLayers" widget is supposed to
do?  Maybe I misunderstand the functionality behind this widget.
------- Comment #3 From 2004-10-29 13:23:11 -------
note that this widget requires php_mapscript_43 or greater.  Please make sure
you are using the latest version of php_mapscript_43 or 44 beta
------- Comment #4 From 2004-10-29 15:35:50 -------
I used php_mapscript_4.2.3 before now I'm using php_mapscript_43 and I get the
same result.
------- Comment #5 From 2004-11-04 14:26:30 -------
The problem here is the all of the data in the chameleon samples occupy most of
the full extents of the map ... even the poppplace layer, you just don't see the
hidden points in popplace.

I'll attach test.tar.gz that contains a test shape file which can be used with
the following layer definition to test this.  Extract test.tar.gz into the data
directory and add the following layer to your map file.
------- Comment #6 From 2004-11-04 14:26:54 -------
LAYER
  GROUP "Point"
  NAME test
  METADATA
    "DESCRIPTION"   "Points"
    "RESULT_FIELDS" "NAME"
    "GROUP" "Point"
    "LAYER" "popplace"
  END
  TYPE POINT
  STATUS ON
  DATA test
  CLASS
    TEMPLATE "ttt_query.html"
    SYMBOL 7
    SIZE 6
    NAME "Cities"
    COLOR 0 0 0
  END
  TOLERANCE 5
PROJECTION
    "init=epsg:42304"
END
END # Layer
------- Comment #7 From 2004-11-04 14:29:14 -------
Created an attachment (id=58) [details]
sample data for testing zoomselectedlayers

extract to data directory of chameleon samples
------- Comment #8 From 2004-11-10 14:55:00 -------
Not working in beta 3 on windows using mapscript 44 beta2 from ms4w 1.0

http://localhost/chameleon/samples/sample_enhanced.phtml

Steps to problem(s):

First issue:
1) Zoomed into Canada.
2) From the legend tab I selected the popplaces Layer by using the radio button.
3) Clicked the Zoom To Selected Layer.
4) I Get the following error:
Fatal error: Call to undefined function: getextent() in
C:\ms4w\apps\chameleon\htdocs\widgets\ZoomSelectedLayers\ZoomSelectedLayers.widget.php
on line 112

Second issue:
1) Reset application 
2) Zoomed into Canada.
3) From the legend tab I selected any of the active layers by using the radio
button.
4) Clicked the Zoom To Selected Layer button.
5) Result: The application only refreshes, does not zooms to full extent only
the current extent. This contradicts Pauls comment #5.

Third Issue:
Paul's test does not work. Norm will comment on this.

Reopening bug. If Paul agress with these issues please, comment of the effort to
fix, if to much set target to FUTURE. 

------- Comment #9 From 2004-11-10 15:25:19 -------
More information:

1) I could not test with data you provided in comments #6 and 7 because of a
problem with points layer.  "GetExtent" method of the layer object does not seem
to be recognized as an existing method.  See comment #8 first issue.

2) I executed another test with polygon shapes in the extents of Nova Scotia (I
will attach the layer and shapes file).  I named this layer "smallpark".  The
extents are:  "minx=232801, miny=20981, maxx=2566221, maxy=470156".  I dumped
the original map extents (called #oQueryExtent, see echo output below).  I also
added an echo after "@$oLayer->queryByRect( $oQueryExtent );" line in
ZoomSelectedLayers.widget.php file.  

Lines added are:

                       "$nResults = $oLayer->getNumResults();
			echo $nResults;
			print_r($oLayer);
			exit;"

I reloaded the "sample_enhanced.phtml" application and clicked on
"ZoomSelectedLayers" widget.  It seems that no shape are found by the query
rectangle.  See echo output.




------------------
echo output:
object(ms_rect_obj)(5) { ["_handle_"]=>  resource(1831) of type (Unknown)
["minx"]=>  float(-2598687.33333) ["miny"]=>  float(-712631) ["maxx"]=> 
float(3471487.33333) ["maxy"]=>  float(3840000) }

results = 0


ms_layer_obj Object
(
    [_handle_] => Resource id #1856
    [_map_handle_] => Resource id #18
    [numclasses] => 1
    [index] => 12
    [status] => 0
    [debug] => 0
    [classitem] => 
    [name] => smallpark
    [group] => Polygon
    [data] => smallpark
    [type] => 2
    [dump] => 0
    [tolerance] => 5
    [toleranceunits] => 6
    [sizeunits] => 6
    [symbolscale] => -1
    [minscale] => -1
    [maxscale] => -1
    [labelminscale] => -1
    [labelmaxscale] => -1
    [maxfeatures] => -1
    [transform] => 1
    [labelcache] => 1
    [postlabelcache] => 0
    [labelitem] => 
    [labelsizeitem] => 
    [labelangleitem] => 
    [tileitem] => location
    [tileindex] => 
    [header] => 
    [footer] => 
    [connection] => 
    [connectiontype] => 1
    [filteritem] => 
    [template] => 
    [transparency] => 0
    [styleitem] => 
    [num_processing] => 0
    [requires] => 
    [labelrequires] => 
    [offsite] => ms_color_obj Object
        (
            [_handle_] => Resource id #1857
            [red] => -1
            [green] => -1
            [blue] => -1
        )

)

------- Comment #10 From 2004-11-10 15:35:51 -------
Created an attachment (id=59) [details]
smallpark.tgz-Compress tar file to test "ZoomSelectedLayer"
------- Comment #11 From 2004-11-10 15:54:42 -------
oddly this works for me and my version is phpmapscript 4.2.3 ... using fgs.
------- Comment #12 From 2004-11-10 16:10:57 -------
I'll take the heat for this one: I never ported the $layer->getExtent() method
to the 4.3 branch in MapServer. It was added only locally in 4.2. I'll look into
this ASAP and it should be in MapServer 4.4. beta3

See http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=826
------- Comment #13 From 2004-11-10 16:15:59 -------
I'm using "php_mapscript_43.so".  Should I use "php_mapscript_4.2.3.so" for
Chameleon?
------- Comment #14 From 2004-11-10 16:17:45 -------
Until 4.4-beta3 is out, you should stick to 4.2.3-4.2.5 for this widget
------- Comment #15 From 2004-11-10 16:22:19 -------
http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=826 refers.  The function was
introduced in mapserver 4.2.3 and has not yet appeared in 4.4 as per comments in
mapserver bug.  Daniel has indicated that he will attempt to finalize this for
the next 4.4 version (beta or final?)

I have added a workaround in the code to detect the  existance of this function
before attempting to use it, and to warn the user if it does not.  Workaround
not tested because I can't easily change to a version of mapscript that doesn't
have this.
------- Comment #16 From 2004-11-11 09:56:39 -------
FYI, MapServer bug--826 was fixed yesterday, so $layer->getExtent() will
definitely be in 4.4.0-beta3 which is due next week.
------- Comment #17 From 2006-09-01 13:06:02 -------
This bug reappears in 2.4 branch (cvs Aug 31 2006) with MS 4.10 beta 2.  I
tested it with smallpark.tgz.
------- Comment #18 From 2007-09-13 14:45:58 -------
This bug is fixed in 2.6.0-rc1.
------- Comment #19 From 2007-09-20 06:49:37 -------
I tryed zoomselectedlayers under MS4W - MapServer 4 Windows - version 2.2.6 with
chameleon_ms4w-2.6.0rc1.
Same situation - it seems that widget just redraws. I used it with
"sample_enhanced.phtml"
------- Comment #20 From 2007-09-24 09:09:40 -------
Re:  comment #19:

I tested it with the data in the attachment and it works.  You need a layer with
smaller extents than the ones in the sample_enhanced application to see the effect.