Closed dehuszar closed 7 years ago
Without running this code personally I see you may have an issue with referencing here:
turbineVector = this.turbineVector;
and:
turbineVector.fillColor = this.severityColors[get(tower, 'severity')];
turbineVector.strokeColor = this.severityColors[get(tower, 'severity')];
causing the source turbineVector
object to be updated to the last value you set. If you instead do:
const turbineVector = Ember.copy(this.turbineVector);
does the bug persist?
In addition to the above I would rewrite:
turbineVector: {
path: "[...]", // using inline svg path
fillColor: '#FF0000',
fillOpacity: 0.6,
scale: 0.05,
strokeColor: '#000000',
strokeWeight: 2
},
// ...
to something like:
turbineVector: Object.freeze({
path: "[...]", // using inline svg path
fillColor: '#FF0000',
fillOpacity: 0.6,
scale: 0.05,
strokeColor: '#000000',
strokeWeight: 2
}),
// ...
So it throws an error for any potential referencing bugs, assigning values to the source object.
Brilliant! Thank you. Both suggestions did the trick nicely.
I'm trying to independently style markers, but they seem to all conform to the last change made. Here's my markers array:
As you can see I'm trying to update the fill and stroke of my marker vector as I iterate through each tower. This doesn't do what I was expecting though. Is this possible? I'm not sure whether this is a GoogleMaps limitation, or an issue with the addon. Do I need to create separate marker arrays for each marker variation?
Thanks in advance, Sam