Skip to content
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

Geostyler style handler #1487

Closed
wants to merge 30 commits into from
Closed

Conversation

ThierryNormand
Copy link
Contributor

Added management of a Geostyler layer. It is able to load throught a context, .json file, layers with a geostyler style.
It reuse already developed method createAsyncLayer. Added part that call geostylerService which use a parser to transform the Geostyle to an OpenLayer style.

Up to date with Angular 16

@ThierryNormand ThierryNormand requested a review from pelord November 6, 2023 13:51
@ThierryNormand ThierryNormand self-assigned this Nov 6, 2023
for (var index in stylesCopy) {
var DescriptorLayerRulesAdapted = [];
let descriptorLayerName = stylesCopy[index].name;
stylesCopy[index].rules.forEach(function (styleRule) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p-etre mettre des arrow function plutot que des function (...) {

styleRule.symbolizers.forEach(function (styleRuleSymbolizer) {
switch (styleRuleSymbolizer.kind) {
case 'Mark':
(styleRuleSymbolizer as MarkSymbolizer).radius = 10;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

crée une doc dans l'entete de la méthode de la raison d'imposer des tailles maximale au radius, width et size

/*

  • ce genre de commentaire. regarde dans le code des examples
    */

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

faire pour chaque méthode svp

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vérifie avec la version 16.x si les dépendances sont encore nécessaire (sauf geostyler-legend et geostyler-openlayers-parser)

stylableLayerOptions.igoStyle?.geoStylerStyle?.global;
const geostylerStyleHover =
stylableLayerOptions.igoStyle?.geoStylerStyle?.hover;
//const globalWriteStyleResult$ = geostylerStyleGlobal ? this.geostylerService.geostylerToOl(geostylerStyleGlobal) : of(undefined);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ca ne va pas plutot dans l'autre pr cette section?

@@ -79,6 +79,14 @@ export class VectorLayer extends Layer {
get exportable(): boolean {
return this.options.exportable !== false;
}
/*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clean up

@@ -100,6 +108,8 @@ export class VectorLayer extends Layer {
}

protected createOlLayer(): olLayerVector<olSourceVector<OlGeometry>> {
// convertir cet objet this.options.igoStyle.geoStylerStyle en objet ol qui sera appliqué
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ca ne va pas plutot dans l'autre pr cette section?

@@ -148,6 +148,7 @@ export class HoverFeatureDirective implements OnInit, OnDestroy {
zIndex: 901,
renderMode: 'vector',
declutter: true,
// style = geostylerstyle.hover converti en ol....
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ca ne va pas plutot dans l'autre pr cette section?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ca ne va pas plutot dans l'autre pr cette section?

catchError,
concatMap,
map
/*, mergeMap*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cleanup

private transferLayersToLegend(styles: GeoStylerStyle[]) {
var stylesCopy = [...styles];
const layerDescriptorsList: GeoStylerStyle[] = [];
for (var index in stylesCopy) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changer vers un foreach si applicable?

styleRule.symbolizers.forEach(function (styleRuleSymbolizer) {
switch (styleRuleSymbolizer.kind) {
case 'Mark':
(styleRuleSymbolizer as MarkSymbolizer).radius = 10;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

faire pour chaque méthode svp

@ThierryNormand
Copy link
Contributor Author

Les changements demandés ci-haut ont été faits

@pelord pelord changed the base branch from next to release/16.x March 13, 2024 14:00
@pelord
Copy link
Member

pelord commented May 16, 2024

superseeded by #1678

@pelord pelord closed this May 16, 2024
@alecarn alecarn deleted the geostylerStyle_handler branch August 14, 2024 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants