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

feat(HideAnnotation): Hide button added to annotations to make them q… #502

Merged
merged 3 commits into from
Jun 12, 2019
Merged

feat(HideAnnotation): Hide button added to annotations to make them q… #502

merged 3 commits into from
Jun 12, 2019

Conversation

lilysikes
Copy link
Collaborator

@lilysikes lilysikes commented Apr 29, 2019

…uickly removeable.

#495

Copy link
Contributor

@wallw-teal wallw-teal left a comment

Choose a reason for hiding this comment

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

The button works but there needs to be an similarly easy method to turn them back on. I also assume that the checkbox doesn't represent the "Show Annotation" state because it is also considering whether or not the geometry is shown? @schmidtk ?

@welchyd
Copy link
Collaborator

welchyd commented May 1, 2019

Annotations don't currently show on geometries (also happens on tracks - #353), so for now the checkbox represents the shown state of the annotation - we need to decide on if the annotation should be tied to the geometry or a separate entity.
I'm in favor of combining them - have the annotation be a label or the floating text and in that case I could see having an icon on the note to show and even toggle the visibility of the annotation itself.

@schmidtk
Copy link
Contributor

schmidtk commented May 2, 2019

KML nodes that support showing an annotation should have a show/hide annotation button in their Layers window UI to toggle the annotation on/off. We still need to work on which nodes support annotations (see the linked track ticket), so we don't need to tackle that here.

That button should control the show flag in os.annotation.OPTIONS_FIELD on the feature, which should in turn control if the annotation exists or not (dispose it if false, create if true). We should not be exposing the annotation via a getAnnotation function to call setVisible because the annotation visibility is impacted by multiple things (node visibility, annotation show flag, timeline) and the overall state is managed by the node.

When the show flag is changed on the feature's annotation options, the node should update the annotation by either disposing the existing annotation or creating a new one. We should update plugin.file.kml.ui.KMLNode#loadAnnotation to handle both of these cases (it currently only handles creating the annotation if one doesn't exist and the flag is true).

If you need a way to notify the node that the option has changed, you can fire a os.events.PropertyChangeEvent on the feature and handle it in plugin.file.kml.ui.KMLNode#onFeatureChange.

schmidtk
schmidtk previously approved these changes May 30, 2019
@schmidtk schmidtk requested a review from wallw-teal May 30, 2019 17:44
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.

4 participants