Hi,
I have already discussed of this with Armin, and as a conclusion, this
is the normal behavior of MapServer.
If you want to change this, in incphp/map.php, change the pmap_zoomrect
function code like this :
/************************************************
* ZOOM&PAN FUNCTIONS
************************************************/
/**
* Zoom to rectangle
*/
function pmap_zoomrect()
{
if (isset($_REQUEST["imgbox"])) {
$imgbox_str = $_REQUEST["imgbox"];
//error_log($imgbox_str);
if ($imgbox_str != "") {
$imgbox_arr = explode(" ", $imgbox_str);
// New map extent in image pixel ((0,0) top-left)
$pix_minx = $imgbox_arr[0];
$pix_miny = $imgbox_arr[1];
$pix_maxx = $imgbox_arr[2];
$pix_maxy = $imgbox_arr[3];
if ($pix_minx == $pix_maxx) $pix_maxx = $pix_maxx + 3;
## increase max extent if min==max
if ($pix_miny == $pix_maxy) $pix_maxy = $pix_maxy - 3; ##
$pixext = ms_newrectObj();
// Modified by Thomas RAFFIN (SIRAP)
// If the rectangle is not in the same proportions than the map,
// only x values are good after zoom.
// To leave the coeff Y / X unghanged, we need to made $geoNewCoeff =
$geo0Coeff...
$geo0Coeff = $this->mapheight / $this->mapwidth;
$geoNewDeltaX = $pix_maxx - $pix_minx;
$geoNewDeltaY = $pix_maxy - $pix_miny;
$geoNewCoeff = $geoNewDeltaY / $geoNewDeltaX;
if ($geoNewCoeff < $geo0Coeff) {
$newDeltaYCorrected = $geo0Coeff * $geoNewDeltaX;
$newDeltaYToAdd = ($newDeltaYCorrected -
$geoNewDeltaY) / 2;
$pix_miny -= $newDeltaYToAdd;
$pix_maxy += $newDeltaYToAdd;
} else {
$newDeltaXCorrected = $geoNewDeltaY / $geo0Coeff;
$newDeltaXToAdd = ($newDeltaXCorrected -
$geoNewDeltaX) / 2;
$pix_minx -= $newDeltaXToAdd;
$pix_maxx += $newDeltaXToAdd;
}
$pixext->setextent($pix_minx,$pix_miny,$pix_maxx,$pix_maxy);
}
// Zoom to full extent when starting
} else {
$pixext = ms_newrectObj();
$pixext->setextent(0, 0, $this->mapwidth, $this->mapheight);
}
$this->map->zoomrectangle($pixext, $this->mapwidth,
$this->mapheight, $this->geoext0);
$pixext->free();
}
masiero emanuele a écrit :
> Hi everyone,
> If I draw a window with "zoom in", the dimensions of the zoomed area should
> adapt to the largest dimension of the drawn window (vertical or horizontal).
> In pmapper instead it adapts only to the horizontal dimension (width), and
> not to the vertical. Therefore if a vertical narrow rectangle is drawn, only
> a square area in its centre will be enlarged, loosing most of the part that I
> wanted to see.
> is it possible to correct this problem?
> thanks
>
> emanuele masiero
> venezia-Italy
> _________________________________________________________________
> Sai che da Messenger puoi controllare la tua posta di Hotmail?
> http://www.messenger.it/better_together.html#posta
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
> _______________________________________________
> pmapper-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/pmapper-users
>
>
>
>
>
>
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
pmapper-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pmapper-users