Closed dbauszus-glx closed 6 days ago
I have updated the tests for the styleParse module.
The check for if keys other than icon and scale occurring in the style.default
object is still failing as bogus keys are not being removed.
it('should remove keys that are not in the default icon object', () => {
const layer = {
format: 'wkt',
key: 'test-layer',
style: {
default: {
testkey: 'test',
icon: {
type: 'target',
fillColor: '#000000',
}
}
}
};
styleParser(layer);
const expected = {
format: 'wkt',
key: 'test-layer',
style: {
default: {
icon: {
type: 'target',
fillColor: '#000000',
}
},
'highlight': { 'zIndex': null }
}
}
// Non-icon key should be removed
assertFalse('testkey' in layer.style.default, 'There should be no other keys other than icon and scale in the default style');
});
Spreading the style should retain the scale property.
https://github.com/GEOLYTIX/xyz/pull/1331/commits/83df594731b8594ff4e61694d6513975e5dd77e5
Working on the cluster and icon scaling plugin we noticed a couple of small issues in regards to the cluster style assignment.
The style.cluster must be spread into the feature.style object to preserve cluster scaling properties.
The logScale is a cluster property not a layer.style property.
The zoomOutScale must be used for the zoomOutScale, not the zoomInScale.
The scale key must not be removed outside the icon in the style.default.
A warning should be issued for the keys which are removed.
The a scale maybe inside and outside an icon. These are all valid.