mapextent

Bart van den Eijnden bartvde at XS4ALL.NL
Fri Feb 11 04:06:57 EST 2005


Hi Richard,

could you check the SIZE of your MAP object, and compare the ratio of
those values (width and height in pixels) to the ratio of your extent
values (width and height in real world coordinates, m)? I could imagine
Mapserver making a correction on the extent you provide if those ratio's
differ.

Also, what you are doing (x and y extent values changed with the same
value, 10000 m), assumes you have a square map size in pixels. Is that
true?

Best regards,
Bart

> Hi MapServer fans,
>
> Just added myself to The List. Since one week i'm into the MapServer
> world.
> Now it's time to get some help of you.
>
> I want to zoom in every time i click my 'zoom in' button. Wat i do is the
> following (MapScript):
>
> $extent = $layer->getExtent();
> $map->setExtent($extent->minx+10000, $extent->miny+10000, $extent->maxx-
> 10000, $extent->maxy-10000);
> $map->save("tmpmapfile.map");
>
> I put the tmpmapfile name in a session so i can use it on and on to zoom
> in
> multiple times.
>
> The original extent is: 13537 306848 278002 619116 (my little country the
> Netherlands). Wat i want to get is: 23537 316848 268002 609116 as my new
> mapextent. But this is wat i get: -364.000000000004 316848 291903 609115
>
> The problem seems to bee de $map->save() because if no new extent is set,
> the new extent (the same as the orginal) contains wrong coords.
>
> Has anybody an idee to solv this? Thanks!!
>
> Richard
>



More information about the mapserver-users mailing list