[OpenLayers-Users] Modifying a vector object's styling

gingerbbm stuart.jones at jacobs.com
Mon Nov 3 10:51:23 EST 2008


Dear all

This is my first post here; I've been goofing around with MapGuide for a
couple of months and am hoping to use OpenLayers to interface with it.

At this point in time I want to override the default styling of a vector
point object. This is what I've got so far:

    ...
    pointTool = new OpenLayers.Control.DrawFeature(
        vectors, // the vector layer
        OpenLayers.Handler.Point
    );
    pointTool.handler.style.fillColor = '#ffffff';
    pointTool.handler.style.strokeColor = '#000000';
    pointTool.handler.style.strokeWidth = 2;
    pointTool.handler.style.fillOpacity = 1;
    ...

It works, but I'm sure this isn't the right way to go about things. I
suspect I need to pass the styling information as an options object to 
http://dev.openlayers.org/releases/OpenLayers-2.7/doc/apidocs/files/OpenLayers/Control/DrawFeature-js.html
OpenLayers.Control.DrawFeature()  but I can't see what properties options
allows. (And this seems to be a common dead-end in the API docs).

I'd appreciate any advice.

Thanks
Stuart
-- 
View this message in context: http://n2.nabble.com/Modifying-a-vector-object%27s-styling-tp1449984p1449984.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.




More information about the Users mailing list