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

bug/#1280 - possibility to draw Polylines using Path #1285

Merged
merged 2 commits into from Sep 26, 2019

Conversation

@monsieurtanuki
Copy link
Collaborator

commented Mar 2, 2019

New classes:

  • PolyOverlayWithIW: extending OverlayWithIW, extended by both Polyline and Polygon given the number of common methods
  • SampleDrawPolylineAsPath: sample similar to SampleDrawPolyline, but where Polylines are drawing in the "path" mode (and not in the "lines" mode)

Impacted classes:

  • CustomPaintingSurface: created mode PolylineAsPath; put alpha in the color in order to see the vertices for Polylines
  • LinearRing: added the boolean member mClosed in order to make both Polyline and Polygon draw using a Path; new constructor for Path with a boolean pClosed parameter; taking into account the mClosed member when building the Path
  • SampleFactory: added SampleDrawPolylineAsPath just after SampleDrawPolyline
  • Polygon: now extends new class PolyOverlayWithIW
  • Polyline: now extends new class PolyOverlayWithIW

Impacted classes - slightly unrelated refactoring regarding Paints:

  • Bug382Crash
  • HeatMap
  • LatLonGridlineOverlay
  • LatLonGridlineOverlay2
  • MarkerDrag
  • MilStdMultipointOverlay
  • OsmMapShapeConverter
  • SampleMilestonesNonRepetitive
  • SampleOsmPath
  • SampleRace
  • SampleZoomToBounding
New classes:
* `PolyOverlayWithIW`: extending `OverlayWithIW`, extended by both `Polyline` and `Polygon` given the number of common methods
* `SampleDrawPolylineAsPath`: sample similar to `SampleDrawPolyline`, but where `Polyline`s are drawing in the "path" mode (and not in the "lines" mode)

Impacted classes:
* `CustomPaintingSurface`: created mode `PolylineAsPath`; put alpha in the color in order to see the vertices for `Polyline`s
* `LinearRing`: added the `boolean` member `mClosed` in order to make both `Polyline` and `Polygon` draw using a `Path`; new constructor for `Path` with a `boolean pClosed` parameter; taking into account the `mClosed` member when building the `Path`
* `SampleFactory`: added `SampleDrawPolylineAsPath` just after `SampleDrawPolyline`
* `Polygon`: now extends new class `PolyOverlayWithIW`
* `Polyline`: now extends new class `PolyOverlayWithIW`

Impacted classes - slightly unrelated refactoring regarding `Paint`s:
* `Bug382Crash`
* `HeatMap`
* `LatLonGridlineOverlay`
* `LatLonGridlineOverlay2`
* `MarkerDrag`
* `MilStdMultipointOverlay`
* `OsmMapShapeConverter`
* `SampleMilestonesNonRepetitive`
* `SampleOsmPath`
* `SampleRace`
* `SampleZoomToBounding`
@conej730

This comment has been minimized.

Copy link

commented Apr 3, 2019

Thanks @monsieurtanuki this is great.

mPath.close();
if (mClosed) {
mPath.close();
}

This comment has been minimized.

Copy link
@conej730

This comment has been minimized.

Copy link
@monsieurtanuki

monsieurtanuki Apr 4, 2019

Author Collaborator

OK

mPath = null;
mLineDrawer = new LineDrawer(256);
mOutline = new LinearRing(mLineDrawer);
////mOutline.clearPath();

This comment has been minimized.

Copy link
@conej730

conej730 Apr 3, 2019

I think this comment could be removed?

This comment has been minimized.

Copy link
@monsieurtanuki

monsieurtanuki Apr 4, 2019

Author Collaborator

Fair enough, mOutline.clearPath(); should be executed and not commented.

}

for (final MilestoneManager milestoneManager : mMilestoneManagers) {
milestoneManager.draw(pCanvas);

This comment has been minimized.

Copy link
@conej730

conej730 Apr 3, 2019

Can the draw be done in the previous loop after the milestone manager is populated, or does it cause delayed draw behavior that way?

This comment has been minimized.

Copy link
@monsieurtanuki

monsieurtanuki Apr 4, 2019

Author Collaborator

We need these two steps.
The first step computes the actual "milestones", which can be something like a milestone every km, or 5 equidistant milestones for the whole length of the polyline. Therefore we need to parse everything first. Then draw, in the second step.

@spyhunter99

This comment has been minimized.

Copy link
Collaborator

commented Apr 3, 2019

let's hold off on merging this until the rest of the bugs are ironed out.

@conej730

This comment has been minimized.

Copy link

commented May 8, 2019

We've been testing with this branch for a bit now. So far no issues have arisen.

@Ruediger34

This comment has been minimized.

Copy link

commented May 12, 2019

I am totally fine with this implementation.
Tested with no performance related impacts or other issues in my use case.

Would be nice to this in the next release.

Thank you @monsieurtanuki

@spyhunter99

This comment has been minimized.

Copy link
Collaborator

commented May 12, 2019

roger that. i want to cut another version before merging this, but it will be first on the list

@monsieurtanuki

This comment has been minimized.

Copy link
Collaborator Author

commented Jun 30, 2019

@spyhunter99 Any progress on a next version?

@spyhunter99

This comment has been minimized.

Copy link
Collaborator

commented Jun 30, 2019

i can cut it today but we still have that one bug with the stack overflow issue

@monsieurtanuki

This comment has been minimized.

Copy link
Collaborator Author

commented Jun 30, 2019

i can cut it today but we still have that one bug with the stack overflow issue

Do you mean only #1299?

@spyhunter99

This comment has been minimized.

Copy link
Collaborator

commented Jun 30, 2019

yup

@monsieurtanuki monsieurtanuki referenced this pull request Aug 26, 2019
@spyhunter99

This comment has been minimized.

Copy link
Collaborator

commented Sep 2, 2019

merge conflicts

@monsieurtanuki

This comment has been minimized.

Copy link
Collaborator Author

commented Sep 3, 2019

solved conflicts

@spyhunter99 spyhunter99 merged commit fadcd07 into master Sep 26, 2019
0 of 2 checks passed
0 of 2 checks passed
continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details
continuous-integration/travis-ci/push The Travis CI build could not complete due to an error
Details
@spyhunter99 spyhunter99 added this to the v6.1.1 milestone Sep 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.