[Mapserver-users] Reference image and extent syntax for on-the-fly configuration

Pericles S. Nacionales nacional at cbs.umn.edu
Tue Apr 13 11:59:43 EDT 2004


Marcelle,

¡Hola!  What you're trying to accomplish won't work.  There's no way to
change template variables (the one's with "[]") in a mapfile (it works
the other way around).  What you need to do is compose your TEMPLATE
parameter via URL and feed it back to the mapfile.  So, in your web
template you'll have a variable "map_layer#_class#_template" (change #
with proper value) and the value would be:

"http://[host]/cgi-bin/mapserv36?map=/data/projects/minnesota/View2/View2.m
ap&title=[EPANAME]&layer=majwshd&map_shapepath=/data/projects/minnesotadata/
View2_final/[ABBREV]&mapext=[minx_left]+[miny_btm]+[maxx_right]+[maxy_top]&i
mgext=[minx_left]+[miny_btm]+[maxx_right]+[maxy_top]&entirewshd=[minx_left]+
[miny_btm]+[maxx_right]+[maxy_top]&map_reference_image=/data/projects/minnes
ota/graphics/ref_maps/[ref_name]&map_reference_extent=[minx_left]+[miny_btm]
+[maxx_right]+[maxy_top]"

But that probably would still not work since you're trying to update
some of the variables as the user interacts with your map.  For it to
work, you'll need to use some javascript and javascript variables (the
MapServer template variables only get updated each time you send your
form back to mapserv36).  So, you'll have to reconstruct the url above
using good old "document.write()" and replacing "[]'s" (except the
[host] which shouldn't change) with javascript variables.

I know.  It's giving my head a spin too.  Others might actually get what
you're trying to accomplish (and can then help you) if you point them to
your application.  Anyway, I hope at least you now understand why it
wouldn't work.

Good luck!
-Perry


On Mon, 2004-04-12 at 22:23, Marcelle Caturia wrote:
> What is the syntax for on-the-fly configuration of the reference image and
> reference extent?  I'd like to specify the reference image name and extent
> using a point-in-polygon query URL, and have unsucessfully tried using the
> following code...
> 
> LAYER # start of zoom to watersheds layer
>   NAME zoom_to_wshd
>   TYPE polygon
>   STATUS default
>   DATA zoom_to_wshd.shp
>   CLASS
>     COLOR 90 0 80
>     OUTLINECOLOR 90 0 80
>     SYMBOL 7
>     TEMPLATE
> "http://[host]/cgi-bin/mapserv36?map=/data/projects/minnesota/View2/View2.m
> ap&title=[EPANAME]&layer=majwshd&map_shapepath=/data/projects/minnesotadata/
> View2_final/[ABBREV]&mapext=[minx_left]+[miny_btm]+[maxx_right]+[maxy_top]&i
> mgext=[minx_left]+[miny_btm]+[maxx_right]+[maxy_top]&entirewshd=[minx_left]+
> [miny_btm]+[maxx_right]+[maxy_top]&map_reference_image=/data/projects/minnes
> ota/graphics/ref_maps/[ref_name]&map_reference_extent=[minx_left]+[miny_btm]
> +[maxx_right]+[maxy_top]"
>   END
> END # end of zoom to watersheds layer
> 
> Any suggestions would be much appreciated.
> 
> Thanks,
> 
> Marcelle Caturia
> Graduate Research Specialist
> Environmental Resources Spatial Analysis Center
> University of Minnesota
> catu0004 at umn.edu
> 
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
-- 
"He's no geek.His tan's too good." -Benjamin Choate





More information about the mapserver-users mailing list