[mapserver-dev] MySQL and Labels

miked130 mikedecker at gmail.com
Thu Nov 13 23:33:06 EST 2008


Hi,

I have data from a shp file I have loaded into MySQL and from my MapFile I
can display the vector data just fine.  However when I go to add in the
Labels (Stored in NAME1 column in the DB) I seem to run into a problem, the
map comes up but I am not seeing a thing.  I'm using OpenLayers to display
the data if that matters.  I'm been looking through the docs and forums and
can't seem to find an example of how this works.

Layer Portion of the map file: (I removed the label portion because it does
not seem to work at all)
 LAYER
    NAME myTest
TYPE LINE
CONNECTIONTYPE OGR
CONNECTION "MYSQL:gis,user=user,password=password"
DATA "SELECT NAME1, ogc_geom FROM gis.testData"
        METADATA
      "wms_title"    "test"   ##required
    "gml_featureid" "gid" ## REQUIRED
      "gml_include_items" "all"  ## Optional (serves all attributes for
layer)
  END
    STATUS ON
        PROJECTION
      "init=epsg:4267"   ##recommended
  END
    CLASS
      NAME "Test Boundaries"    
      STYLE
        COLOR 200 100 100
      END
    END
  END

On the open layers side I have:

 var layer = new OpenLayers.Layer.WMS( "test layer",
                           
"http://localhost/cgi-bin/mapserv.exe?map=test.map", {layers: "myTest",
transparent: "true", extractAttributes: true},
                    {gutter: 15});
           
            map.addLayer(layer);

Thanks in advance.
-- 
View this message in context: http://www.nabble.com/MySQL-and-Labels-tp20494577p20494577.html
Sent from the Mapserver - Dev mailing list archive at Nabble.com.



More information about the mapserver-dev mailing list