-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update vectorlayer styling in map-cesium #207
Conversation
Updated and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: @types/[email protected] |
fillColor: '#FFFFFF', | ||
strokeColor: '#0072a3', | ||
strokeWidth: 2, | ||
clampToGround: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can find a better solution here so that the values are not duplicated in the object.
Here is how this object is used in the other mapping libraries
map-ol:
if (l.options) { if (l.options) { const style = l?.options?.style;
map-maplibre:
ukis-frontend-libraries/projects/map-maplibre/src/lib/maplibre-layers.helpers.ts
Line 188 in dd51dd6
const style = l?.options?.style as StyleSpecification;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found a way to access the style properties in a similar way as in map-maplibre. Therefore, I removed the duplicate entries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice.
Thanks @lucas-angermann for this PR! I'll try to check it out soon. |
@@ -21,8 +21,8 @@ | |||
"dependencies": { | |||
"@dlr-eoc/services-map-state": "12.0.0-alpha.2", | |||
"@dlr-eoc/services-layers": "12.0.0-alpha.2", | |||
"@cesium/engine": "^3.0.2", | |||
"@cesium/widgets": "^3.0.2", | |||
"@cesium/engine": "^6.1.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updating libraries in the major version could be considered a breaking change.
@voinSR and @MichaelLangbein I think we discussed this once. But with a lot of libraries in our repo, the versions could get very high very quickly. We have to decide how to deal with that.
For now, it is ok because this library was only available as an alpha version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I wanted to update the versions before we create a new release of the libraries.
if(l.options && l.options.style){ | ||
const styleProperties = l.options.style(l.data)[0]; | ||
if(styleProperties){ | ||
fillColor = Color.fromCssColorString(styleProperties.fill_.color_) || fillColor; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not optimal to use private properties from OpenLayers here, but we can change that later.
Maybe we can define some common style properties.
l.options.style{
fillColor?: string;
strokeColor?: string;
strokeWidth?: string;
strokeOpacity?: number;
fillOpacity?: number;
circleRadius?: number;
iconImg?: any;
...
}
@voinSR what do you think about it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be ideal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lucas-angermann thanks for the PR and fixes!
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Vector layers are only displayed in the Cesium default style.
What is the new behavior?
Vector layers can now be styled with optional input.
Does this PR introduce a breaking change?
Other information
Is it part of one/more packages and which?
@dlr-eoc/map-cesium