[OpenLayers-Users] Vector Styling of points retrieved with BBOX and OpenLayers.

Michael mdm at yachtpc.com
Tue Jul 12 18:29:01 EDT 2011


I am building a function to display navigational markers (there are a 
bit over 50 thousand of them in the US).

For ease of implementation, I'm just using a BBOX strategy and a text 
file as in the example at 
http://openlayers.org/dev/examples/dynamic-text-layer.html.

What I'd like to do is, instead of a graphic as the icon, insert a nice 
vector feature with a number or letter in it (such as a green square 
with a "2" in it)

I'm assuming that applying a stylemap to the layer is the trick, if it's 
possible.  Or did I read somewhere that it's image files only?

Thanks!

Michael

Desired stylemap

             var myStyles = new OpenLayers.StyleMap({
               "default": new OpenLayers.Style({
                 strokeWidth: 2,
                 graphicName: "circle", //to be variable, as are colors
                   fillColor: "red",
                 strokeColor: "green",
                   fillOpacity: 0.5,
                   strokeOpacity: 0.7,
                 pointRadius: 12,
                 graphicZIndex: 1,
                   label: "Test", //will be variable
                   labelYOffset: 17,
               }
             )});


More information about the Users mailing list