简体   繁体   中英

OpenLayers 3: multi-color points

I found this OpenLayers 3 example as a great basis for my project: http://openlayers.org/en/master/examples/igc.html

However, I would like to change one thing and I can't find out how to do it. When value of the input (under the map) is changed, red points appear on the tracks showing where each aircraft was at that time. I would like to have the red points to be of different colors for each track, so that it is easy to understand who is who. It can be the same array colors, or another array.

You could use custom properties. It is possible to access them through feature.get('name') when rendering and then vary the color based on that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM