Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
bskania
Posts: 105
Registered: ‎04-24-2012
My Device: blackberry developer

Blackberry map issue

Hello,

 

 I am currently developing the application based on map. I am able to get the current location i.e coordinates through GPS. I am currently in India. When I try to use Blackberry map its not showing me the my current location on map. So is it possible to view my current location any how on map? I want to display route between two landmarks and basically its of India. I don't want to use any 3rd party map like google. I want to use native blackberry location based service. So any help form you guys are welcomed.

 

Thanks In advance.

bskania.

Developer
pradeep_ch
Posts: 543
Registered: ‎12-23-2010
My Device: Z10

Re: Blackberry map issue

Hi bskania,

 

Due to unavailability of map data for like india, you cant draw directions.

You can show the current location using the location document.

for that you have to convert the latitude and longitude as shown below.

 

see the code snippet.

 

Latitude = (int) (locObj.getQualifiedCoordinates().getLatitude() * 100000);
Longitude = (int) (locObj.getQualifiedCoordinates().getLongitude() * 100000);

now invoke maps like this.

String document = "<lbs clear='ALL'><location lon='" + Longitude + "' lat='" + Latitude + "' label='" + LocName + "' zoom='2'/></lbs>";
Invoke.invokeApplication(Invoke.APP_TYPE_MAPS, new MapsArguments(MapsArguments.ARG_LOCATION_DOCUMENT, document));

 

Thanks.

Developer
bskania
Posts: 105
Registered: ‎04-24-2012
My Device: blackberry developer

Re: Blackberry map issue

Thanks For reply.
I know the way that you had suggested. I had tried with that for some US based location.
If I want to display route between two place I need to open Blackberry map. Is it the only option?
I can not do it using map field or Rich Map Field?

Thanks again for your help.
Developer
pradeep_ch
Posts: 543
Registered: ‎12-23-2010
My Device: Z10

Re: Blackberry map issue

 

You can only draw directions if the mapdata is available.

 

And one thing, MapField and RichMapField also using same map data.

 

so it is not possible.

 

Thanks. 

Developer
bskania
Posts: 105
Registered: ‎04-24-2012
My Device: blackberry developer

Re: Blackberry map issue

Hey can you provide me some example for displaying route between two places on rich map field,

Thanks.
Developer
pradeep_ch
Posts: 543
Registered: ‎12-23-2010
My Device: Z10

Re: Blackberry map issue

Developer
bskania
Posts: 105
Registered: ‎04-24-2012
My Device: blackberry developer

Re: Blackberry map issue

Hello,

I already review that link.

But its about to get kml file from the web server like google.

There is no other way then google or generating its on own server?

I mean I dont want to use webservice.

Then, there is the only way to invoke the map and pass the destination to view route.

 

If any thing I am missing then let me know.

Thanks,

bskania.