Google maps API makes it possible to create a layer on the map containing a polyline linking points together.
I have searched where I could to find an example or an implementation for this for gluon's mapLayer.
Please advice
Google maps API makes it possible to create a layer on the map containing a polyline linking points together.
I have searched where I could to find an example or an implementation for this for gluon's mapLayer.
Please advice
While there's no explicit API for drawing lines, polylines or polygons on top of a
MapView
, theMapLayer
is a layer where you can draw any JavaFXShape
, providing you take care of scaling it to the map coordinates.For that, if you have a look at the
PoiLayer
class, you can see that for anyMapPoint
(defined by latitude and longitude) you can get a 2D point (defined by x and y), and you can draw a node at that position:So if you want to create, for instance, a
Polygon
based on a set of points, you have to add aPolygon
object to the layer:Now, on the demo class, create a set of mapPoints, and add them to the map:
And you will have a map with your geo-located polygon on top of it.