You need to log in before you can comment on or make changes to this bug.
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
Changed target to 1.99 RC 1.
Chris, could you explain me what the "ZoomSelectedLayers" widget is supposed to do? Maybe I misunderstand the functionality behind this widget.
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
I used php_mapscript_4.2.3 before now I'm using php_mapscript_43 and I get the same result.
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.
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
Created an attachment (id=58) [details] sample data for testing zoomselectedlayers extract to data directory of chameleon samples
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.
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 ) )
Created an attachment (id=59) [details] smallpark.tgz-Compress tar file to test "ZoomSelectedLayer"
oddly this works for me and my version is phpmapscript 4.2.3 ... using fgs.
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
I'm using "php_mapscript_43.so". Should I use "php_mapscript_4.2.3.so" for Chameleon?
Until 4.4-beta3 is out, you should stick to 4.2.3-4.2.5 for this widget
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.
FYI, MapServer bug--826 was fixed yesterday, so $layer->getExtent() will definitely be in 4.4.0-beta3 which is due next week.
This bug reappears in 2.4 branch (cvs Aug 31 2006) with MS 4.10 beta 2. I tested it with smallpark.tgz.
This bug is fixed in 2.6.0-rc1.
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"
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.