[mapserver-users] Build Errors; Currently "msLoadMap(): Unknown identifier. First token must be MAP, this doesn't look like a mapfile. "

Fawcett, David (MPCA) David.Fawcett at state.mn.us
Thu Nov 19 09:26:57 EST 2009


If you still get an error, you will want to make sure that your MAP has an associated END line to close out the MAP block.  It will likely be the last line in your map file.

David.

From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Richard Marsden
Sent: Thursday, November 19, 2009 8:13 AM
To: Smith, Michael ERDC-CRREL-NH; mapserver-users at lists.osgeo.org
Subject: Re: [mapserver-users] Build Errors; Currently "msLoadMap(): Unknown identifier. First token must be MAP, this doesn't look like a mapfile. "

Thanks Michael - that has pointed me in the right direction and I now have a working "Hello World".

I had already tried the "MAP" on the first line, but this was giving a parsing error on line 1. I assumed this referred to the "MAP" in the map file, but it was actually due to a lack of the "magic string" in the template.

Even with those two changes there was another error on "line 1". This was actually due to the form field for "map_web_imagepath". Commenting it out resulted in a working Hello World template.  Luckily it quoted the problem (the directory value), but saying "Line 1" was very misleading for this error.

As a general comment:  With hindsight, these errors make some sense, but it is very confusing as to know where (ie. which file) is causing the error. "Line 1" is very well, but which file???

Now to convert the application map files. Hopefully I just need to add the "MAP"s at the top. I'll check the symbol defs as well.

Cheers,

Richard



On Wed, Nov 18, 2009 at 9:32 PM, Smith, Michael ERDC-CRREL-NH <michael.smith at usace.army.mil<mailto:michael.smith at usace.army.mil>> wrote:
Richard,

Add a new line to the beginning of your mapfile of just the word MAP.

Eg
MAP

NAME "Hello_World"
SIZE 400 300
IMAGECOLOR 249 245 186
IMAGETYPE png
EXTENT -1.00 -1.00 1.00 1.00
Its part of some security changes in the latest version of Mapserver. You also need to add a SYMBOLSET to the top of symbol files and a new magic token to templates

See here
http://mapserver.org/development/rfc/ms-rfc-56.html
For more info

Mike


--
Michael Smith
RSGIS Center
US Army Corps of Engineers


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20091119/5bc40e5e/attachment.html


More information about the mapserver-users mailing list