[OpenLayers-Dev] Random Colors on Vector Features?
Christopher Schmidt
crschmidt at metacarta.com
Mon Mar 3 15:49:38 EST 2008
On Mon, Mar 03, 2008 at 01:29:54PM -0700, Tim Schaub wrote:
> >> I'm curious about your use case. I don't have a good idea how common it
> >> is to want to style a feature in a way that has nothing to do with its
> >> attributes.
> >
> > I'm making a Facebook-API based "friends map" of users hometowns, by
> > ...
> > since when they stack on top of each other, it's hard to know how many
> > are really in a stack.
>
> Sounds cool. I would guess that you'll not be adding much meaning to
> the map if you symbolize a pile of markers with random colors. I think
> grouping and using marker size to represent multiple markers is more
> intuitive. In the end, I bet more people can make sense of markers if
> they are symbolized by something meaningful about the feature they
> represent. This has nothing to do with GIS, just common sense.
Sure, but I wanted something I could implement. Since I don't have the
knowledge to implement grouping, it isn't covered here.
> > I don't see a useful way to make this work as an attribute filter. A
> > FeatureID filter would be fine, but I'm not sure I understand the
> > benefit of a FeatureID based filter over usig a symbolizer directly, so
> > long as I want a fixed selection style (not based on FID). Perhaps
> > there's some aspect of this I'm not understanding.
>
> You're right, if you want each feature to have a symbolizer that you
> generate at construction, you can tack that symbolizer on to the
> features themselves. And if you want all features to look the same when
> selected (regardless of what they looked like before they were
> selected), then you have no use for anything more than a selectedStyle
> attribute on the select feature control.
Great. That's all I needed: apparently I just screwed something up while
testing it. Thanks for the confirmation.
Regards,
--
Christopher Schmidt
MetaCarta
More information about the Dev
mailing list