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

Uudised

Viimane: Thu, 15 Mar 2012 14:51:08
Teema: Vabad töökohad pakkuda
Veel uudiseid »

trailing zero problem with WgsPoint coordinates

3 replies [Last post]
navad
User offline. Last seen 52 weeks 19 hours ago. Offline
Joined: 11/03/2010

I need to pass some coordinates to two WgsPoint objects to calculate a route. My application receives them as String (via a Blackberry push) but WgsPoint wants them in double and with exactly six digits in the fractions part. Now if my String coordinate ends with a zero and I transfer it to double the zero is dropped, my coordinate has only five digits in the fractions part and it does not work anymore.
I have not managed to keep that zero during transformation. Using DecimalFormat obviously does not work for double objects. It works only when I want to print it to an output stream as a string. This all would be so much easier if WgsPoint accepted String as parameters. Does anyone have an idea how to solve this?

navad
User offline. Last seen 52 weeks 19 hours ago. Offline
Joined: 11/03/2010

I could get it working now. It seems like the trailing zeros were not the problem and I mixed up to coordinates at some other place.

kvy04
User offline. Last seen 21 weeks 5 hours ago. Offline
Joined: 07/20/2011

Hi navad,

how do you pass the coordinates to calculate a route between two wgspoints? is there a function to calculate the route between two points? i need to draw a line on the map to display a route between two wgspoints. i'm wondering how to calculate/know the wgspoints in between the two wgspoints in order to draw the line. hope you can help me here.

thank you in advance.

jaak
User offline. Last seen 4 days 20 hours ago. Offline
Joined: 06/19/2008

For route calculation there is DirectionsService http://www.nutiteq.com/javadoc/com/nutiteq/services/DirectionsService.html . As it relays on web services then it has has asynchronous listener-based interface, so you need to implement DirectionsListener to get response.

There is sample for it for Androi: https://bitbucket.org/nutiteq/android-map-samples/src/22be5730c7a3/src/com/nutiteq/andsample/routing . BlackBerry implementation would be the same from Nutiteq SDK point of view, but for UI handling it needs different approach.

/JaakL