MCPcopy Create free account
hub / github.com/CrunchyData/pg_eventserv / getIconStyle

Function getIconStyle

examples/moving-objects/moving-objects.js:24–43  ·  view source on GitHub ↗
(feature)

Source from the content-addressed store, hash-verified

22// generated style to reflect that
23var iconStyleCache = {};
24function getIconStyle(feature) {
25 var iconColor = feature.get('color');
26 if (!iconStyleCache[iconColor]) {
27 iconStyleCache[iconColor] = new ol.style.Style({
28 image: new ol.style.RegularShape({
29 fill: new ol.style.Fill({
30 color: iconColor
31 }),
32 stroke: new ol.style.Stroke({
33 width: 1,
34 color: 'grey'
35 }),
36 points: 16,
37 radius: 6,
38 angle: Math.PI / 4
39 })
40 });
41 }
42 return iconStyleCache[iconColor];
43};
44
45// Download the current set of moving objects from
46// the pg_featureserv

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected