[mapserver-users] confused about using zoomRectangle

Tamas Szekeres szekerest at gmail.com
Fri Mar 6 14:11:28 EST 2009


I'm using this one for C# which is working fairly well.

public void ZoomRectangle(double minx, double miny, double maxx, double
maxy)
        {
            if (map != null && (maxx - minx) > 2 && (maxy-miny) > 2)
            {
                using (rectObj imgrect = new rectObj(minx, miny, maxx, maxy,
0))
                {
                    // mapscript requires this hack
                    imgrect.miny = maxy;
                    imgrect.maxy = miny;

                    map.zoomRectangle(imgrect, map.width, map.height,
map.extent, null);
                    this.RefreshView();
                    return;
                }
            }
        }


I guess the same would work for java as well.

Best regards,

Tamas


2009/3/6 Ahmet Temiz <temiz at deprem.gov.tr>

>  *hi,
> thank you
>
> I had tried two ways you mentioned as 1 and 2
>
> "1" is *rectObj(10,10,100,100,0)
> *"2" is *rectObj(10,100,100,10,0)
>
> both resulted exception.
>
> what I want to know is that if I can create any image box providing
> keeping the same size.
>
> I mean rectOb(11,11,101,101) and rectOb(12,12,102,102) and so on have same
> effect
> on zoomRectangle.
>
> regards
> *
> On Fri, 6 Mar 2009 16:42:45 +0100, Tamas Szekeres wrote*
> > Hi,
> >
> > I guess you've run into the problem reported in
> > http://trac.osgeo.org/mapserver/ticket/1988
> > http://trac.osgeo.org/mapserver/ticket/1817
> >
> > and some other related tickets.
> >
> > I'm not sure why this issue haven't been addressed yet, seem you have to
> swap the miny and maxy values in the rectangle before passing to
> zoomRectangle right now.
> >
> > Best regards,
> >
> > Tamas
> >
> > 2009/3/6 Ahmet Temiz <temiz at deprem.gov.tr>
> >
>>
>> hello
>> >
>> > I am using mapserver-java-mapscript.
>> >
>> > I am very confused about using zoomRectangle.
>> >
>> > I tried zoomRectangle in two ways. But I still have exception.
>> >
>> > here is the java code I tried and related exception results:
>> >
>> > 1..
>> >
>> > rectObj imgrect =new rectObj(10,10,100,100,0);
>> > map0.zoomRectangle(imgrect, 500, 500, map0.getExtent(), null);
>> >
>> > SEVERE: java.lang.UnknownError: mapscript::mapObj::zoomRectangle():
>> > General error message. image rectangle maxy >= miny
>> > javax.faces.el.EvaluationException: java.lang.UnknownError:
>> > mapscript::mapObj::zoomRectangle():
>> > General error message. image rectangle maxy >= miny
>> >
>> > ~~~~~~~~~~~~~~~~
>> > 2..
>> >
>> > rectObj imgrect =new rectObj(10,100,100,10,0);
>> > map0.zoomRectangle(imgrect, 500, 500, map0.getExtent(), null);
>> >
>> > SEVERE: java.lang.UnknownError: rectObj():
>> > Invalid rectangle. { 'minx': 10.000000 , 'miny': 100.000000 , 'maxx':
>> > 100.000000 , 'maxy': 10.000000 }
>> > javax.faces.el.EvaluationException: java.lang.UnknownError: rectObj():
>> > Invalid rectangle. { 'minx': 10.000000 , 'miny': 100.000000 , 'maxx':
>> > 100.000000 , 'maxy': 10.000000 }
>> > ~~~~~~~~~~~~~~~~
>> >
>> > I will appreciate, if you give your sense.
>> >
>> > regards
>> > --
>> > Open WebMail Project (http://openwebmail.org)
>> >
>> > --
>> > 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
>> >
>
>
> >
> > --
> > This message has been scanned for viruses and
> > dangerous content by *MailScanner* <http://www.mailscanner.info/>, and
> is
> > believed to be clean.
>
>
> --
> Open WebMail Project (http://openwebmail.org)
>
>
> --
> This message has been scanned for viruses and
> dangerous content by *MailScanner* <http://www.mailscanner.info/>, and is
> believed to be clean.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20090306/925767c8/attachment.html


More information about the mapserver-users mailing list