I'm working with OpenStreetMap in Java with JMapViewer. I can draw polygon and rectangle using JMapViewer, but how to draw polyline?
Thank you.
I'm working with OpenStreetMap in Java with JMapViewer. I can draw polygon and rectangle using JMapViewer, but how to draw polyline?
Thank you.
AFAIK JMapViewer extends JPanel.
Therefore you just override paintComponent and use the given Graphics object.
You could create your own implementation of a polyline. Below is an example that is based on existing
MapPolygonImpl
. It is hacky, but there seem to be no method inJMapViewer
to add lines.