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