Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
343 views
in Technique[技术] by (71.8m points)

gps - How to find the route between two places in BlackBerry?

How do I find the route information between two places in BlackBerry?

I'm using MapField to show the map in my application.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

As I understood, you need to get a path length between several locations.
It's not possible in MapField, you can only set that route by yourself.

Invoke BB Maps for route direction

You can always use MapField in you application for simple functionality, like present locations, and use BlackBerry Maps application for enhanced stuff like select locations and route directions presentation for user.

To invoke BB Maps for route direction use code:

Invoke.invokeApplication(Invoke.APP_TYPE_MAPS,
                        new MapsArguments(
                        MapsArguments.ARG_LOCATION_DOCUMENT,document));

With document formed like:

<location-document>
     <GetRoute>
        <location lon='-8030000' lat='4326000' label='Kitchener, ON' description='Kitchener, Ontario, Canada' />
        <location lon='-7569792' lat='4542349' label='Ottawa, ON' description='Ottawa, Ontario, Canada' />
     </GetRoute>
</location-document>

Result will be like
alt text http://www.blackberry.com/knowledgecentersupport/kmsupport/supportknowledgebase/images/DB-00599_3.jpgalt text http://www.blackberry.com/knowledgecentersupport/kmsupport/supportknowledgebase/images/DB-00599_4.jpg

Now, in BlackBerry Maps you can register your App menu item and start or update your App with selected location using MapView.
See How To - Add an ApplicationMenuItem to BlackBerry Maps

UPDATE

Use the gmap navigation service for driving directions

See J2ME/Android/BlackBerry - driving directions, route between two locations


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...