[OpenLayers-Users] Markers with dymamically changing appearance

Guyren Howe guyren at mac.com
Wed Aug 11 02:47:26 EDT 2010


New to Openlayers. Great project, many thanks to all who put so much work into creating and documenting it!

What would be the idiomatic way to have the markers on my map with part of their appearance being dynamically generated and changeable?

This is to display relative temporal information on the markers: as the user changes their location in time instead of space, using controls outside of the map itself, I need my markers to change their appearance in a dynamically-generated (ie local javascript) fashion.

It would be possible to have a fixed set of graphics that they switch between, but there would be a largish number of these, so it would be preferable to just generate them locally via Javascript. Best of all possible worlds would probably be to fetch a "base" marker and then copy it, add the custom graphic as a layer on top of it, drop it on the map, then be able to get at it and just change its custom layer with javascript drawing commands (I'm okay with having to use HTML5 for this, but I'd prefer not to).

The graphic I want to draw on top of the marker isn't complicated — two or three lines at right angles, so I should be able to dynamically update even a fair number of markers assuming there isn't a massive drawing overhead.


More information about the Users mailing list