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

feature(Style): points can now be displayed as icons #1715

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mgermerie
Copy link
Contributor

Description

Add support to display points as label icons in a ColorLayer or a LabelLayer.

If user defines Style.point of a ColorLayer, and set the ColorLayer addLabelLayer parameter to true, points will be displayed as label icons. If addLabelLayer is unset or set to false, point will be kept rasterized.
User can also define Style.point for a LabelLayer, in which case points will obviously be displayed as label icons.

@mgermerie mgermerie marked this pull request as draft September 16, 2021 12:37
@mgermerie mgermerie added the feature 🍏 Adds a new feature label Sep 16, 2021
@mgermerie mgermerie added this to the 2.35.0 milestone Sep 16, 2021
@gchoqueux gchoqueux modified the milestones: 2.35.0, 2.36.0 Sep 16, 2021
@mgermerie mgermerie force-pushed the feature-points branch 2 times, most recently from 72fb2f7 to 8250e82 Compare September 17, 2021 08:43
src/Layer/LabelLayer.js Outdated Show resolved Hide resolved
Comment on lines 97 to 85
this.style.icon = this.style.icon || {};
this.style.icon.source = canvas.toDataURL();
this.style.point.color = undefined;
this.style.point.line = undefined;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure to keep this part....

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changing this.style.icon.source is necessary so that the canvas drawing is displayed as icon. The following two lines prevent drawing points projected on ground, as can be seen in the attached screenshot. Moreover, they do not actually change the Style object defined by the user. Do you still think I should remove them ?
Capture d’écran du 2022-02-15 12-00-18

@gchoqueux gchoqueux modified the milestones: 2.36.0, 2.37.0 Nov 18, 2021
@gchoqueux gchoqueux modified the milestones: 2.37.0, 2.38.0 Feb 8, 2022
@mgermerie mgermerie requested a review from gchoqueux March 8, 2022 14:27
@mgermerie mgermerie marked this pull request as ready for review March 8, 2022 14:27
@mgermerie mgermerie force-pushed the feature-points branch 2 times, most recently from 959624c to 4ea5fef Compare March 15, 2022 15:54
@gchoqueux gchoqueux modified the milestones: 2.38.0, 2.39.0 Apr 13, 2022
@mgermerie mgermerie force-pushed the feature-points branch 3 times, most recently from 1ef6de6 to 5041fcb Compare May 25, 2022 13:21
@mgermerie mgermerie force-pushed the feature-points branch 7 times, most recently from 5e6c230 to eb581e6 Compare June 3, 2022 08:13
@mgermerie mgermerie force-pushed the feature-points branch 4 times, most recently from d05e7ed to 8632725 Compare June 7, 2022 10:25
@mgermerie mgermerie force-pushed the feature-points branch 9 times, most recently from 5431108 to cc5de42 Compare June 13, 2022 11:37
@gchoqueux gchoqueux modified the milestones: 2.39.0, 2.40.0 Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 🍏 Adds a new feature to-specify
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants