I'm using this one for C# which is working fairly well.<br><br>public void ZoomRectangle(double minx, double miny, double maxx, double maxy)<br> {<br> if (map != null && (maxx - minx) > 2 && (maxy-miny) > 2)<br>
{<br> using (rectObj imgrect = new rectObj(minx, miny, maxx, maxy, 0))<br> {<br> // mapscript requires this hack<br> imgrect.miny = maxy;<br>
imgrect.maxy = miny;<br><br> map.zoomRectangle(imgrect, map.width, map.height, map.extent, null);<br> this.RefreshView();<br> return;<br> }<br>
}<br> }<br><br><br>I guess the same would work for java as well.<br><br>Best regards,<br><br>Tamas<br><br><br><div class="gmail_quote">2009/3/6 Ahmet Temiz <span dir="ltr"><<a href="mailto:temiz@deprem.gov.tr">temiz@deprem.gov.tr</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff">
<font size="2"><b>hi,
<br>thank you
<br>
<br>I had tried two ways you mentioned as 1 and 2
<br>
<br>"1" is </b></font><font size="2">rectObj(10,10,100,100,0)</font>
<br><font size="2"><b>"2" is </b></font><font size="2">rectObj(10,100,100,10,0)
<br>
<br>both resulted exception.
<br>
<br>what I want to know is that if </font><font size="2">I can create any image box providing keeping the same size.
<br>
<br>I mean </font><font size="2">rectOb(</font><font size="2">11,11,101,101) and </font><font size="2">rectOb(</font><font size="2">12,12,102,102) and so on have same effect
<br>on </font><font size="2">zoomRectangle.
<br>
<br>regards
<br></font><font size="2"><b>
<br>On Fri, 6 Mar 2009 16:42:45 +0100, Tamas Szekeres wrote</b>
<br><div><div></div><div class="h5">>
Hi,
<br>>
<br>> I guess you've run into the problem reported
in
<br>> <a href="http://trac.osgeo.org/mapserver/ticket/1988" target="_blank">http://trac.osgeo.org/mapserver/ticket/1988</a>
<br>>
<a href="http://trac.osgeo.org/mapserver/ticket/1817" target="_blank">http://trac.osgeo.org/mapserver/ticket/1817</a>
<br>>
<br>> and some other related tickets.
<br>>
<br>> 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.
<br>>
<br>>
Best regards,
<br>>
<br>> Tamas
<br>>
<br>> 2009/3/6 Ahmet Temiz <span dir="ltr"><<a href="mailto:temiz@deprem.gov.tr" target="_blank">temiz@deprem.gov.tr</a>></span>
<br>>
<blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">
hello
<br>>
<br>>
I am using mapserver-java-mapscript.
<br>>
<br>>
I am very confused about using zoomRectangle.
<br>>
<br>>
I tried zoomRectangle in two ways. But I still have exception.
<br>>
<br>>
here is the java code I tried and related exception results:
<br>>
<br>>
1..
<br>>
<br>>
rectObj imgrect =new rectObj(10,10,100,100,0);
<br>>
map0.zoomRectangle(imgrect, 500, 500, map0.getExtent(),
null);
<br>>
<br>>
SEVERE: java.lang.UnknownError: mapscript::mapObj::zoomRectangle():
<br>>
General error message. image rectangle maxy >= miny
<br>>
javax.faces.el.EvaluationException: java.lang.UnknownError:
<br>>
mapscript::mapObj::zoomRectangle():
<br>>
General error message. image rectangle maxy >= miny
<br>>
<br>>
~~~~~~~~~~~~~~~~
<br>>
2..
<br>>
<br>>
rectObj imgrect =new rectObj(10,100,100,10,0);
<br>>
map0.zoomRectangle(imgrect, 500, 500, map0.getExtent(), null);
<br>>
<br>>
SEVERE: java.lang.UnknownError: rectObj():
<br>>
Invalid rectangle. { 'minx': 10.000000 , 'miny': 100.000000 ,
'maxx':
<br>>
100.000000 , 'maxy': 10.000000 }
<br>>
javax.faces.el.EvaluationException: java.lang.UnknownError: rectObj():
<br>>
Invalid rectangle. { 'minx': 10.000000 , 'miny': 100.000000 ,
'maxx':
<br>>
100.000000 , 'maxy': 10.000000 }
<br>>
~~~~~~~~~~~~~~~~
<br>>
<br>>
I will appreciate, if you give your sense.
<br>>
<br>>
regards
<br>>
--
<br>>
Open WebMail Project (<a href="http://openwebmail.org/" target="_blank">http://openwebmail.org</a>)
<br>>
<br>>
--
<br>>
This message has been scanned for viruses and
<br>>
dangerous content by MailScanner, and is
<br>>
believed to be clean.
<br>>
<br>>
_______________________________________________
<br>>
mapserver-users mailing list
<br>>
<a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a>
<br>>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a>
<br>>
</blockquote>
<br>>
<br></div></div>> --
<br><div class="im">> This message has been scanned for viruses
and
<br>> dangerous content
by
<a href="http://www.mailscanner.info/" target="_blank"><b>MailScanner</b></a>, and
is
<br>> believed to be
clean.
<br>
<br>
<br></div>--
<br><div class="im">
Open WebMail Project (<a href="http://openwebmail.org/" target="_blank">http://openwebmail.org</a>)
<br>
<br>
</div></font>
</div><div><div></div><div class="h5">
<br>--
<br>This message has been scanned for viruses and
<br>dangerous content by
<a href="http://www.mailscanner.info/" target="_blank"><b>MailScanner</b></a>, and is
<br>believed to be clean.
</div></div></blockquote></div><br>