Dear all,

I want to draw a Polyline from GMap, but I used ArrayList for adding
the points to be drawn and then convert this ArrayList to array as
such:
        LatLng point;
        List<LatLng> points = new ArrayList<LatLng>(5);

        point = LatLng.newInstance(-34.402130,150.899139);
        points.add(point);
        point = LatLng.newInstance(-34.402239,150.900324);
        points.add(point);

        Polyline line = new Polyline( (LatLng[])points.toArray() );
        map.addOverlay(line);

But if I used array for the points as such:
        LatLng point;
        LatLng[] points = new LatLng[5];
        point = LatLng.newInstance(-34.402130,150.899139);
        points[0] = point;
        point = LatLng.newInstance(-34.402239,150.900324);
        points[1] = point;

        Polyline line = new Polyline( points );
        map.addOverlay(line);
It works.

Why does the first lines of code does not work? Could anyone give  me
an idea?

Thank you.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to