On Tue, Aug 5, 2008 at 11:04 AM, Jani Patokallio <[EMAIL PROTECTED]> wrote:
> Greetings,
>
> A very simple question, probably with a very simple answer, but I'm
> having a devil of a time figuring it out...
>
> I have a PointTrack layer with a StyleMap attached to it.  The StyleMap
> says strokeColor: yellow, so when I draw vectors on the layer, they're
> yellow.  My question is, how do I specify that one (1) vector should
> *not* be yellow, but red?
>
> Feature.Vector has style objects as an optional argument, but I have no
> idea what "style {Object} An optional style object" is supposed to mean,
> and my guess at "new Vector(point, {foo: "bar"}, {strokeColor: "red"})"
> does nothing.

If you create a feature using:

feature = new OpenLayers.Feature.Vector(point, {foo: "bar"},
    OpenLayers.Util.applyDefaults({"strokeColor": "red"},
OpenLayers.Feature.Vector.style["default"]);

that should work.

--
Eric
_______________________________________________
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users

Reply via email to