[mapserver-users] RE: shpxy example

Lime, Steve D (DNR) Steve.Lime at state.mn.us
Mon Nov 29 16:02:13 EST 2010


Hi John: The ids variable is used to perform a runtime substitution. It's not a MapServer specific variable, just something I used in that particular example. In the mapfile here's the county layer:

  LAYER
    NAME county
    STATUS OFF
    DATA "data/bdry_counpy2_gen500"
    TYPE POLYGON
    CLASS
      EXPRESSION ('[COUN]' in '%ids%')
      STYLE
        COLOR "#BD9E5D" # "#A27528"
        OUTLINECOLOR 50 50 50
      END
    END
    CLASS
      COLOR 255 255 255
      OUTLINECOLOR 50 50 50
    END
    TEMPLATE "templates/county_example.html"
  END

The value for the CGI variable ids is substituted into the first class expression at runtime.  So, if ids=1,2,3,4,5 then the class expression becomes ('[COUN]' in '1,2,3,4,5'). Ideally one should set a validation pattern for the ids variable to limit it's possible values.

So, once the expression is changed if the attribute COUN is in the list of ids then we draw with the pukey brown, if not, then draw white. Does this help?

Steve



From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Jackson, John
Sent: Friday, November 26, 2010 7:54 AM
To: mapserver-users at lists.osgeo.org
Subject: [mapserver-users] shpxy example

HI again all,

I'm working on a project where I'm trying to do the same thing as the shapexy example linked from http://mapserver.org/output/imagemaps.html

I've got an html imagemap working, and enough javascript together that it correctly concatenates a link, but the link doesn't end up working...
The part I don't understand how to get the map working in map mode. I'm not understanding the "ids" variable that is getting passed to mapserver. Are the id's a field in the data set? I don't see any documentation for it anywhere, and when I pass it, I just get my map back without anything selected.

Again, thanks in advance for your help.
Hope everyone had a wonderful thanksgiving.

--John Jackson
--Deputy Auditor
--Franklin County Ohio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20101129/be2aee33/attachment-0001.html


More information about the mapserver-users mailing list