Resubmit Question: ms4w, variable substitution, mapfile EXTENT object attr

Matthew Perry perrygeo at GMAIL.COM
Wed Dec 6 14:25:28 EST 2006


Matt,

 Mapserver CGI has a built-in parameter to set the map extent called
"mapext" ; its a '+' delimited list of your bounding extents. Just
hardcode anything (usually the maximum extent of you data) into the
mapfile and set the &mapext parameter in your URL to change it.

http://mapserver.gis.umn.edu/docs/reference/cgi/controls

- matt perry

On 12/6/06, Matt Pettis <matt.pettis at thomson.com> wrote:

> I am trying to write a mapfile that will use javascript to dynamically sent
> EXTENT values to a .map file via POST parms. Concretely, when I select a
> county in MN from a dropdown, I want to send the appropriate values for the
> EXTENT bbox so that the selected county is rendered in it's specific bbox.
>
>
>
> The beginning of my mapfile looks like this:
>
> ---
>
> MAP
>
> IMAGETYPE PNG
>
> EXTENT %xmin% "%ymin%" "%xmax%" "%ymax%"
>
> SIZE 880 660
>
> ...
>
> ---
>
>
>
> the url i issue is:
>
> http://localhost/cgi-bin/mapserv.exe?map=C%3A%5Cms4w%5CApache%5Chtdocs%5Ctest_postgis2%5CDynSQL_ByCounty%5Cmap.map&map_web_imagepath=C%3A%5Cms4w%5CApache%5Chtdocs%5Ctmp%5C&mode=map&xmin=439430.71875&ymin=4959166&xmax=486045.78125&ymax=5010473.5&coid=27
>
>
>
>
>
> the error i get is:
>
> getDouble(): Symbol definition error. Parsing error near (%):(line 7)
>
>
>
> line 7 is the EXTENT line.
>
>
>
> So, my questions are:
>
> 1. Does MapServer support variable substitition for extent values? If so,
> what am i doing wrong? If not, how do I dynamically set the extent for
> dynamically selected polygons with different bboxes?
>
>
>
> 2. Is there a better way to set the bbox rather than send it precalculated
> values in a GET? It seems natural that I should be able to leave the EXTENT
> line off and a default of the smallest bounding box that works for the
> returned geometry would be returned as a default.
>
>
>
> tia,
>
> Matt


-- 
Matthew T. Perry
GIS Analyst / Software Engineer
National Center for Ecological Analysis and Synthesis (NCEAS)
work: perry at nceas.ucsb.edu
web: http://www.perrygeo.net



More information about the mapserver-users mailing list