juanantonio.fernandez@uca.es, hartpence_gis@co.jasper.ia.us,

John Smith jayzee.smith at GMAIL.COM
Mon Oct 23 11:43:19 EDT 2006


guys,
i'm sooo close to making my own rubberband except i got a *small* problem- i
don't quite understand img/pixelspace and map/extentspace (probably the most
repeated question on this forum).

anyway the map zooms to the extent i provide but the extent i provide (from
the click-and-drag zoombox) is wrong. see if you can iron out my warped
understanding:

img size = current map exent

i convert user click to where that click'd be inside the map extent like so-
click_point_in_map_extent = sign_of_map_quadrant * (click_point_of_img *
([maxx] - [minx]))/[mapwidth];

img/pixelspace
                                0,0 ---------
                                    |          |
                                    |          |
                                    |          |
                                     --------- [mapwidth], [mapheight]

map/extentspace
                            [-, + ] --------- maxx, maxy [+, +]
                                    |          |
                                    |          |
                                    |          |
                                     ---------
            minx, miny [-, -]            [+, -]

does this even look right? if it's right then when the user clicks on the
center of the map img the converted point on the map extent'd be 0,0! that
doesn't make much sense.

anyway my screen resolution doesn't effect, my user click capture looks
right, so what gives?
jzs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20061023/7f065f6a/attachment.html


More information about the mapserver-users mailing list