Image transparency via SWIG API

Rick Innis rick at INNIS.CA
Mon May 16 20:54:07 EDT 2005


> Rick, you say everything works fine when you load the same layer via a
> mapfile ... so why not do that?

The application allows each user, or group of users, to view different
data layers superimposed on the same base map. This is running as a web
service, so we don't want to have to manage potentially hundreds or
thousands of maps that differ only in one or two layers.

> I'm going to need more details on your
> use before I can be of any help such as how you are styling and
> rendering the points, and perhaps the relevant portion of the mapfile
> that works.

OK, and thanks. In reverse order, then, here's the mapfile fragment:

         LAYER
                 NAME user_data
                 STATUS on
                 CONNECTION "user=XXXX password=YYYY dbname=ZZZZ
host=localhost port=5432"
                 CONNECTIONTYPE postgis
                 DATA "the_geom from j_random_table"
                 TYPE point
                 CLASS
                         NAME "pins"
                         STYLE
                                 BACKGROUNDCOLOR 0 255 0
                                 COLOR 0 255 0
                                 SYMBOL ../../Image/Pin/pin_black_map.gif
                         END
                 END
         END

And the code:

        // Corresponds to the LAYER statement above
        layerObj l = new layerObj(map);
        l.setType(MS_LAYER_TYPE.MS_LAYER_POINT);
        l.setConnectiontype(MS_CONNECTION_TYPE.MS_POSTGIS);
        l.setConnection(connectionString);
        l.setData(geomString);
        l.setStatus(mapscriptConstants.MS_ON);
        l.setName("data_layer");

        // corresponds to CLASS statement
        classObj c = l.getClass(0);
        // paranoia?
      if (c == null)
                c = new classObj(l);
        // this seems to be needed in the API version of this
        c.setStatus(mapscriptConstants.MS_ON);

        // create a symbolObj and insert it into the map's symbol set
        symbolObj so = new symbolObj("pin",pinPath);
        symbolSetObj ss = map.getSymbolset();
        ss.appendSymbol(so);
        // create a style object to attach the symbol to
        styleObj style = new styleObj(c);
        style.setSymbol(1);
        style.setSymbolname("pin");

I've also attached the resulting map, though I'm not sure if the list
will strip it or not.

Thanks for any insight you can provide. In my perfect world the
solution is something simple, even if not obvious :-)

        --Rick.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: map9561.png
Type: image/png
Size: 5209 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/mapserver-users/attachments/20050516/cddd3eb3/map9561.png


More information about the mapserver-users mailing list