<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Hi Jelmer,<br>&nbsp;&nbsp;&nbsp; Concering ZoomRectangle you said "I'll be working with more than one coord system"<br>&nbsp;&nbsp;&nbsp; From that I get the following:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1. Either you mean that the coordinate system of the map can change during the application<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; flow (alas you change your projection using mapObj.SetProjection(...) (the most usual)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2. Or the map projection stays put and you want to input a rectangle expressed in various<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; projections to use with ZoomRectangle<br>&nbsp;&nbsp;&nbsp; In both cases (where different coordinate systems are involved) you still need a way to reproject<br>&nbsp;&nbsp;&nbsp;&nbsp; the input coordinates to the current map object projection. After you do this a function like the <br>&nbsp;&nbsp;&nbsp;&nbsp; one i posted, can do the trick and convert to image coordinates (so you can use ZoomRectangle)<br><br>&nbsp;&nbsp;&nbsp; As for the next problem you describe, I can't tell much because you use the FullExtent variable for<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; which I can not know its contents (is it expressed in lat/long maybe i don't know, if so you must<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reproject lat/long to the map projection too). Possible a glimpse at your mapfile would help. <br><br>&nbsp;&nbsp;&nbsp; Sorry if my post is not so useful to you but errors and misconceptions using mapscript are very common.<br><br>Regards,<br>Jim<br><br>&gt; Subject: RE: [mapserver-users] MapScript and ZoomRectangle (and rectObj        problems)<br>&gt; Date: Sun, 3 May 2009 13:20:54 +0200<br>&gt; From: Baas@speerit.nl<br>&gt; To: mapserver-users@lists.osgeo.org<br>&gt; <br>&gt; Jim, List, <br>&gt;  <br>&gt; Thanks for the reply. I'm afraid that eventually I'll be working with<br>&gt; more than one coord system, so I don't believe your solution can work<br>&gt; for me.<br>&gt;  <br>&gt; I've been continueing my testing, and it seems like all MapScript zoomto<br>&gt; functions either work unlike I expect them, or are completely broken. I<br>&gt; tried to following:<br>&gt;  <br>&gt; In the immediate pane in VB .Net:<br>&gt; ? map.setCenter(new pointObj(143000,485437,0,0))<br>&gt; 0<br>&gt; ? map.extent<br>&gt; {OSGeo.MapServer.rectObj}<br>&gt; maxx: 143397.59497452341<br>&gt; maxy: 485654.62790724094<br>&gt; minx: 142602.40502547659<br>&gt; miny: 485219.37209275906<br>&gt; <br>&gt; This seems to work properly. Now the following:<br>&gt; ? map.zoomScale(1000, new pointObj(143000,485437,0,0),mapwidth,<br>&gt; mapheight,map.extent, nothing)<br>&gt; 0<br>&gt; ? map.extent<br>&gt; {OSGeo.MapServer.rectObj}<br>&gt; maxx: 225008.64025899942<br>&gt; maxy: 207042.5828362515<br>&gt; minx: 224520.10434931691<br>&gt; miny: 206775.17742509485<br>&gt; <br>&gt; When I change map.extent to fullExtent (which is set after loading, in<br>&gt; this case the extents of the Netherlands)<br>&gt; ? map.zoomScale(1000, new pointObj(143000,485437,0,2),mapwidth,<br>&gt; mapheight,FullExtent, nothing)<br>&gt; 0<br>&gt; ? map.extent<br>&gt; {OSGeo.MapServer.rectObj}<br>&gt;     maxx: 85315130.06053336<br>&gt;     maxy: -353386875.22545278<br>&gt;     minx: 85314641.524623737<br>&gt;     miny: -353387142.6308639<br>&gt; <br>&gt; These numbers are completely unexpected. Even though I'm not sure about<br>&gt; the zoomscale of 1000, the extent returned doesn't make any sense.<br>&gt; MapWidth = 1384. mapHeight = 758<br>&gt; <br>&gt; This is really a huge problem for us at the moment. I hope someone can<br>&gt; shed some light on this.<br>&gt; <br>&gt; Thanks in advance,<br>&gt; Jelmer Baas<br>&gt; _______________________________________________<br>&gt; mapserver-users mailing list<br>&gt; mapserver-users@lists.osgeo.org<br>&gt; http://lists.osgeo.org/mailman/listinfo/mapserver-users<br><br /><hr />Windows Live™: Keep your life in sync. <a href='http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t1_allup_explore_012009' target='_new'>Check it out!</a></body>
</html>