Using Javascript to update maps in a web page

Daniele Margotti margottid at COMUNE.LUGO.RA.IT
Sun Nov 14 09:09:03 EST 2004


Hi,
I have a question about using Javascript to update maps in a web page.

If I don't want to reload the page every time I request a new map, I can
use javascript to re-create - on the fly - only objects that change, for
instance "map" (using: img src="/cgi-bin/mapserv?mode=map...."), "scalebar"
(using: img src="/cgi-bin/mapserv?mode=scalebar....") and "reference"
(using: img src="/cgi-bin/mapserv?mode=reference....").

When I use MapServer CGI, some variables (current scale, current
extent, ...) are automatically updated by MapServer that substitutes the
field name (e.g.: [scale]) in the template.

Can I obtain these values from MapServer only using Javascript?
I think I cannot calculate these values with Javascript functions because
MapServer, when creates a map, modifies the requested extent (and,
consequently, the scale) adjusting it on the base of pixel size, right?
So... Is there a "mode" in MapServer that outputs, instead of a
map/scalebar/reference image, a value (for current scale or current extent)?


Thank you,
   Daniele



More information about the mapserver-users mailing list