dlsc-software-consulting-gmbh / GMapsFX

Java API for using Google Maps within a JavaFX application.
http://rterp.github.io/GMapsFX/
Apache License 2.0
319 stars 119 forks source link

Unable to add Polyline to a GoogleMap #32

Closed luigiruocco closed 8 years ago

luigiruocco commented 10 years ago

I use GMapsFX 1.1.1 I try to add a Polyline to GoogleMap with this code:

LatLong ll1 = new LatLong(47.6197, -122.3231); LatLong ll2 = new LatLong(47.6297, -122.3431); LatLong[] ary = new LatLong[]{ll1, ll2}; MVCArray mvc = new MVCArray(ary); PolylineOptions polyOpts = new PolylineOptions() .path(mvc) .strokeColor("red") .strokeWeight(2); Polyline poly = new Polyline(polyOpts); map.addMapShape((MapShape) poly);

In the last line of code I get a compilation error because the polyline is not an instance of MapShape. Where is the mistake?

TomKrauss commented 9 years ago

Hi Luigiruocco

you are probably using the "wrong" Polyline class. There is a class Polyline in package com.lynden.gmapsfx.javascript.object an one in package com.lynden.gmapsfx.shapes. The later one is the one to use in your case.

luigiruocco commented 9 years ago

Hi, thanks for response!!! It work!

rterp commented 8 years ago

Closing this issue.