[mapserver-users] problem with zoomRectangle

Umberto Nicoletti umberto.nicoletti at gmail.com
Mon May 4 06:17:13 EDT 2009


I use this code to build the zoomRectangle (note the 1 which allows
for  miny >= maxy):

return new rectObj(
                (getXAsDouble() < getX2AsDouble() ) ? getXAsDouble() :
getX2AsDouble(),
                (getYAsDouble() < getY2AsDouble() ) ? getY2AsDouble()
: getYAsDouble(),
                (getXAsDouble() < getX2AsDouble() ) ? getX2AsDouble()
: getXAsDouble(),
                (getYAsDouble() < getY2AsDouble() ) ? getYAsDouble() :
getY2AsDouble(),
                1 // image coordinates, allow for miny >= maxy
                );

where X,Y and X2,Y2 are class attributes.

HTH,
Umberto

On Mon, May 4, 2009 at 11:32 AM, orkun <temiz at deprem.gov.tr> wrote:
> hello
>
> I am working on java-mapscript
>
> I have a problem with zoomRectangle:
>
> here it is
>
> rect_left: 377.000
> rect_top: 120.000
> rect_width: 52
> rect_height: 36
>
> rectObj rect_img=new rectObj(rect_left,500-(rect_top+rect_height),
> rect_left+rect_width,500-rect_top,0)  ; // 500 map dimensions
>
> rect_img.toString() { 'minx': 377 , 'miny': 344 , 'maxx': 429 ,
> 'maxy':380 }  // for checking it looks ok
>
> map0.zoomRectangle(rect_img,500,500,map0.getExtent(),null);
>
> it gives:
>
> Caused by: java.lang.UnknownError: mapscript::mapObj::zoomRectangle():
> General error message. image rectangle maxy >= miny
>
> when I change the places of miny and maxy . it does not work again
>
> what is the wrong I am doing ?
>
> regards
> --
> Ahmet Temiz
> Jeo. Müh.
> Afet İşleri Gen. Md.lüğü
> Deprem Ar. D.
>
> Ahmet Temiz
> Geo. Eng.
> General Dir. of
> Disaster Affairs
> TURKEY
>
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>


More information about the mapserver-users mailing list