[Mapserver-users] tutorial

Pericles S. Nacionales nacional at cbs.umn.edu
Thu Jun 17 16:39:21 EDT 2004


Jenu,

Thanks for pointing it out.  The tutorial need some serious updating and
I'm hoping to find some time for that in the near future.  What I think
you mean is that there seems to be an explanation missing as to how the
"clickable" reference map works.

Here's the explanation: If you look at the line on the HTML template
file containing the tag [ref] and compare it with the line containing
the tag [img], they are the same.  Keep in mind that both the reference
map and the main map have extent definitions.  In the case of the main
map, the extent changes as you pan, or zoom.  With the reference map,
the extent doesn't change. (As to why it doesn't, you should be able to
answer that... just look at the image.)  Now, when you click on the
reference map, the mouse coordinates are passed through the MapServer
CGI as [ref.x] and [ref.y] (or as [refxy]) and a new extent on the main
map is calculated.  Since the ref.x and ref.y are in pixel coordinates,
they will have to be converted into map units and the new map extent
will then be calculated with these new map coordinates as the center
point (MapServer does all that).  Meanwhile, the reference extent
remains the same.

The same thing happens, by the way, when you click on the main map--the
mouse coordinates are passed to the MapServer CGI.  In this case, the
variables used are img.x and img.y.

I hope I didn't confuse you.

Now, if you don't want your reference map clickable, just replace the
line "<input type="image" name="ref" src="[ref]" border="0">" with "<img
src="[ref]" border="0">".

Thanks again for pointing this out.  Now I'll just go back to this reply
when I update that example. :)

-Perry


On Thu, 2004-06-17 at 14:36, Jenu Abraham wrote:
> it seems that some of the mapserver tutorial codes given, does not match 
> what they show...
> 
> for example in tutorial 2.4
> 
> http://terrasip.gis.umn.edu/cgi-bin/mapserv40?map=/data/projects/tutorial/example2-4.map&layer=states&mode=browse
> 
> the map recenters according to the click on the reference map...
> but it does not say how in the tutorial....
> 
> 
> jenu
> 
> _________________________________________________________________
> Looking to buy a house? Get informed with the Home Buying Guide from MSN 
> House & Home. http://coldwellbanker.msn.com/
> 
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
-- 
Pericles S. Nacionales

Conservation Biology Program
University of Minnesota
URL:    http://hypnos.cbs.umn.edu/~pnaciona/
E-Mail: nacional at cbs.umn.edu
Phone:  612 624 6713





More information about the mapserver-users mailing list