Il 21:58, lunedì 19 marzo 2007, Armin Burger ha scritto:
> I think the patch from Alessandro will work for several zoom functions,
> but not for all. E.g. not for zoom via a rectangle (zoombox) on the map.

Yes, Armin you're right,
here is the patch for zoombox:

Insert after
http://svn.pmapper.net/trac/browser/pmapper/trunk/incphp/map.php#L483

                // ABP: check scale
                $x_pix = ($pix_maxx + $pix_minx) / 2;
                $y_pix = ($pix_maxy + $pix_miny) / 2;
                $xy_pix = ms_newPointObj();
                $xy_pix->setXY($x_pix, $y_pix);
                $minscale = $this->map->web->minscale;
                $zoom_factor = $this->mapwidth / ($pix_maxx - $pix_minx);
                if($zoom_factor < 1){
                    $zoom_factor = - 1 / $zoom_factor;
                }
                //error_log("$zoom_factor");
                $new_scale =  ($zoom_factor > 0) ? $this->old_geo_scale / 
$zoom_factor : $this->old_geo_scale * ( - $zoom_factor);
                //error_log("$new_scale < $minscale");
                if($zoom_factor != 1 && $this->old_geo_scale && $new_scale < 
$minscale){
                    return $this->map->zoomscale($minscale + 0.1, $xy_pix, 
$this->mapwidth, $this->mapheight, $this->geoext0, $this->maxextent);
                }
                // ABP: End


-------------------------------
Also a small fix to the previous zoompoint patch:

Insert after
http://svn.pmapper.net/trac/browser/pmapper/trunk/incphp/map.php#L519

        // ABP: check scale
        $minscale = $this->map->web->minscale;
        //error_log($minscale);
        //error_log($this->zoom_factor);
        $new_scale =  ($this->zoom_factor > 0) ? $this->old_geo_scale / 
$this->zoom_factor : $this->old_geo_scale * ( - $this->zoom_factor);
        //error_log($this->old_geo_scale);
        if($this->zoom_factor != 1 && $this->old_geo_scale && $new_scale < 
$minscale){
            return $this->map->zoomscale($minscale + 0.1, $xy_pix, 
$this->mapwidth, $this->mapheight, $this->geoext0, $this->maxextent);
        }
        //*/




-- 
Alessandro Pasotti
itOpen - "Open Solutions for the Net Age"
w3:  www.itopen.it
Linux User# 167502

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
pmapper-users mailing list
pmapper-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pmapper-users

Reply via email to