Hi Jelmer,
    Concering ZoomRectangle you said "I'll be working with more than one coord 
system"
    From that I get the following:
       1. Either you mean that the coordinate system of the map can change 
during the application
              flow (alas you change your projection using 
mapObj.SetProjection(...) (the most usual)
       2. Or the map projection stays put and you want to input a rectangle 
expressed in various
              projections to use with ZoomRectangle
    In both cases (where different coordinate systems are involved) you still 
need a way to reproject
     the input coordinates to the current map object projection. After you do 
this a function like the 
     one i posted, can do the trick and convert to image coordinates (so you 
can use ZoomRectangle)

    As for the next problem you describe, I can't tell much because you use the 
FullExtent variable for
      which I can not know its contents (is it expressed in lat/long maybe i 
don't know, if so you must
        reproject lat/long to the map projection too). Possible a glimpse at 
your mapfile would help. 

    Sorry if my post is not so useful to you but errors and misconceptions 
using mapscript are very common.

Regards,
Jim

> Subject: RE: [mapserver-users] MapScript and ZoomRectangle (and rectObj       
> problems)
> Date: Sun, 3 May 2009 13:20:54 +0200
> From: [email protected]
> To: [email protected]
> 
> Jim, List, 
>  
> Thanks for the reply. I'm afraid that eventually I'll be working with
> more than one coord system, so I don't believe your solution can work
> for me.
>  
> I've been continueing my testing, and it seems like all MapScript zoomto
> functions either work unlike I expect them, or are completely broken. I
> tried to following:
>  
> In the immediate pane in VB .Net:
> ? map.setCenter(new pointObj(143000,485437,0,0))
> 0
> ? map.extent
> {OSGeo.MapServer.rectObj}
> maxx: 143397.59497452341
> maxy: 485654.62790724094
> minx: 142602.40502547659
> miny: 485219.37209275906
> 
> This seems to work properly. Now the following:
> ? map.zoomScale(1000, new pointObj(143000,485437,0,0),mapwidth,
> mapheight,map.extent, nothing)
> 0
> ? map.extent
> {OSGeo.MapServer.rectObj}
> maxx: 225008.64025899942
> maxy: 207042.5828362515
> minx: 224520.10434931691
> miny: 206775.17742509485
> 
> When I change map.extent to fullExtent (which is set after loading, in
> this case the extents of the Netherlands)
> ? map.zoomScale(1000, new pointObj(143000,485437,0,2),mapwidth,
> mapheight,FullExtent, nothing)
> 0
> ? map.extent
> {OSGeo.MapServer.rectObj}
>     maxx: 85315130.06053336
>     maxy: -353386875.22545278
>     minx: 85314641.524623737
>     miny: -353387142.6308639
> 
> These numbers are completely unexpected. Even though I'm not sure about
> the zoomscale of 1000, the extent returned doesn't make any sense.
> MapWidth = 1384. mapHeight = 758
> 
> This is really a huge problem for us at the moment. I hope someone can
> shed some light on this.
> 
> Thanks in advance,
> Jelmer Baas
> _______________________________________________
> mapserver-users mailing list
> [email protected]
> http://lists.osgeo.org/mailman/listinfo/mapserver-users

_________________________________________________________________
Windows Liveā„¢: Keep your life in sync. Check it out!
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t1_allup_explore_012009
_______________________________________________
mapserver-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to