2

Using MapServer and generating a static map. I am trying to pass a key of a record through CGI and have MapServer draw it. From what I understand if I have a name=example in my CGI call to my MapServer then inside the MapServer config file I can reference the parameter wit '%name%'. But it does not seem to work.

Here is my layer configruation:

LAYER
    NAME "devlocx"
  GROUP "alarmloc"
    STATUS DEFAULT
    TYPE POINT
    CONNECTIONTYPE postgis
    CONNECTION "host=localhost dbname=osm user=osm password=osm port=5432"
    #DATA "geometry from ptx using srid=3857 using unique gid"
    DATA "geometry from (select gid,name, (st_transform(geometry,3857)) as geometry from ptx  where name='%name%') as foo using unique gid using srid=3857"
    ###########################
    # Define the cluster object
    ###########################
    CLASS
      STYLE
        SIZE 30
        SYMBOL "cir"
        COLOR 255 0 0
      END
    END
END
SYMBOL
 name "cir"
 type ellipse
 points 1 2 end
 filled true
END
  • I changed the title from CHI to match the the body CGI references; please edit if incorrect. – Vince Aug 12 '19 at 10:42
  • You must add also a VALIDATION block.for "name" – user30184 Aug 12 '19 at 15:24
  • user30184. You win. I would accept the answer if you put it in answer form. Otherwise I will add it later. – Tommie Jones Aug 12 '19 at 16:08
  • @TommieJones, you are welcome to answer and gather some reputation. – user30184 Aug 13 '19 at 7:04
0

My issue was I did not include the VALIDATION Block. Once I created a VALIDATION block and validated the parameters it worked immediately

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.