Map API

Nutiteq Maps Lib SDK enables developing advanced mobile mapping applications.
Platforms: Android, RIM BlackBerry, Java ME (J2ME)
Download maps API SDK »
Untitled Document

Products

» View demos
» Downloads

Latest news

Last at Tue, 6 Dec 2011 18:37:53
Topic: New BlackBerry sample app
See more news »

Display Polyline with array of Points

2 replies [Last post]
miked06
User offline. Last seen 34 weeks 1 day ago. Offline
Joined: 07/26/2010

Hi all,

I have an array of gps points that represents a route that I would like to display on a map. Is there a simple and effective way to convert these points into some sort of a polyline shape such as in google maps? I'm trying to determine if this library will suit our needs, and this is the last unknown.

Thanks,

Mike

jaak
User offline. Last seen 13 hours 11 min ago. Offline
Joined: 06/19/2008

Yes, you can:


// 1. make array with some dummy points
WgsPoint[] linePoints = {
new WgsPoint(24.76382468302337, 59.44325151314919),
new WgsPoint(24.76344295658494, 59.4462352840583),
new WgsPoint(24.76593650384734, 59.44530921763007),
new WgsPoint(24.76804665483925, 59.44616268729941),
new WgsPoint(24.76810500478219, 59.443291656657) };

// 2. create label for line (optional)
final PlaceLabel lineLabel = new PlaceLabel("LineLabel");

// 3. create line itself, declare style

Line line = new Line(linePoints, new LineStyle(0xFF00FF00, 1), lineLabel);

// 4. add line to the map
mapComponent.addLine(line);

/JaakL

miked06
User offline. Last seen 34 weeks 1 day ago. Offline
Joined: 07/26/2010

Thanks Jaaak, This is a great library!