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

VTM Style: allow adding dropDistance directly (related to #1082) #1085

Merged

Conversation

eddiemuc
Copy link

This PR adds a new parameter dropDistance to the VTM Style object. In addition to the already existing boolean parameter pointReduction (which, if set, applies a default fixed dropDistance to lines/points/polygons), it allows to specify a dropDistance directly.

This parameter can be used to mitigate the zooming problems specified in #1082.

The PR also adds an example polyline to the android-example VectorLayerActivity in the area of Hamburg, Germany. demonstrating the usage of this parameter.

Zooming in:
image
image
image
image
image
image
image
image

.fillAlpha(0.2f);
.buffer(0.5)
.fillColor(Color.RED)
.fillAlpha(0.2f);
Copy link
Collaborator

Choose a reason for hiding this comment

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

The formatting has changed?
We use the default IDEA settings.

Copy link
Author

Choose a reason for hiding this comment

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

Sorry, I will correct this

this.pointReduction = false;
this.dropDistance = dropDistance;
return this;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

For clarity we should avoid changing multiple parameters in one setter.

As we add the dropDistance parameter that already exists in LineBucket,
we can remove the pointReduction and simplify the functions.

Copy link
Author

Choose a reason for hiding this comment

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

I hesitated to remove the "pointReduction" parameter because I feared that change would be breaking to existing users of the lib. Is this not an issue?

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is not a common method and we will mention it in changelog.

Please see commit ee602a3, something like that should work?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@eddiemuc you can update the pull request if you like.

@eddiemuc eddiemuc force-pushed the issues/vtm-style-allow-dropdistance-config branch from b1c757d to 35a3dbe Compare December 18, 2023 09:30
@eddiemuc
Copy link
Author

@devemux86 PR was updated

@devemux86
Copy link
Collaborator

PR was updated

Thanks! Can you reformat VectorLayerActivity?
IDEA still corrects the imports and indentation.

@devemux86
Copy link
Collaborator

Ctrl + Alt + Shift + L or Ctrl + Alt + L

@eddiemuc
Copy link
Author

PR was updated

Thanks! Can you reformat VectorLayerActivity?
IDEA still corrects the imports and indentation.

I am currently AFK, will do this later.

Not so easy for me, I have non-standard settings in my IDE (from cgeo)

@devemux86
Copy link
Collaborator

@eddiemuc no problem! 🙂
I can do it on top of your pull request.

@eddiemuc
Copy link
Author

@eddiemuc no problem! 🙂
I can do it on top of your pull request.

If you can, I would appreciate it. Thanks!

@devemux86 devemux86 merged commit 31646b3 into mapsforge:master Dec 18, 2023
1 check passed
@devemux86 devemux86 added this to the 0.21.0 milestone Dec 18, 2023
@devemux86
Copy link
Collaborator

@eddiemuc thanks!

@eddiemuc
Copy link
Author

@eddiemuc thanks!

Thanks to you as well!

@eddiemuc eddiemuc deleted the issues/vtm-style-allow-dropdistance-config branch December 18, 2023 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants