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

Add directional arrows to polylines #791

Closed
jmarks213 opened this issue Nov 28, 2017 · 4 comments
Closed

Add directional arrows to polylines #791

jmarks213 opened this issue Nov 28, 2017 · 4 comments

Comments

@jmarks213
Copy link

Issue Type

[x] Improvement

I needed to add directional arrows to the polylines for indicating direction between points and wanted to share the end result. Maybe someone else will find it useful.

For example,
screenshot_20171128-155839

@spyhunter99
Copy link
Collaborator

#611 related issue

This is pretty cool! Testing now, i can see lots of use cases for aviation maps, vectors and waypoints, etc

spyhunter99 added a commit to jmarks213/osmdroid that referenced this issue Nov 29, 2017
spyhunter99 added a commit to jmarks213/osmdroid that referenced this issue Nov 29, 2017
# Conflicts:
#	OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/SampleFactory.java
spyhunter99 added a commit to jmarks213/osmdroid that referenced this issue Dec 2, 2017
jmarks213 pushed a commit to jmarks213/osmdroid that referenced this issue Dec 3, 2017
monsieurtanuki added a commit that referenced this issue Dec 5, 2017
Add directional arrows on polylines
@pasniak
Copy link
Contributor

pasniak commented Dec 22, 2017

Is it doable to have labels aligned to polylines? Something like:
screenshot from 2017-12-21 20-44-18

@monsieurtanuki
Copy link
Collaborator

@pasniak I think this goes far beyond the "arrow" feature for many reasons, among them: what parametrized text should we display and how should we split the text if the segment zigzags? In comparison, for arrows we just always display the same small Path (or bitmap in #809).
That being said, the implementation of the angled text would be something like

canvas.save();
canvas.rotate(orientation, centerX, centerY);
// here it's a bitmap, but you can put a text instead
canvas.drawBitmap(bitmap, centerX - bitmap.getWidth() / 2, centerY - bitmap.getHeight() / 2, null);
canvas.restore();

@spyhunter99
Copy link
Collaborator

@pasniak one approach you could take is to look at the milstd2525 renderer. There's a standardized graphic for this. It looks a lot like an air space corridor or something like that. Your (developer) workflow would be:

  • add the renderer to your project
  • add osmbonusback
  • figure out what the symbol code is
  • figure out your control points (basically the start/end points and a width)
  • have the renderer make you a kml doc
  • use osmbonus pack to convert the kml to a folder overlay
  • add the folder overlay to the map

the following is what it looks like in the spec (milstd2525c), which is in the ball park of what you're looking for. http://www.dtic.mil/doctrine/doctrine/other/ms_2525c.pdf for the full spec

image

of course, you could just build the polygons yourself. The text labels can be created on the fly too with the marker class

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants