How to show current location (the green dot) on MapField in Blackberry Java SDK

603 views Asked by At

Here's the frustrating problem.

As you know, we can use net.rim.device.api.lbs.maps.ui.RichMapField in blackberry api to integrate the map feature into our mobile application.

So I use it in my application. The RichMapField works fine, as I can see streets and roads, I just can't see where i am in the map - There should be a green/blue dot that represents where I am. And the GPS icon at the top left corner shouldn't have a red cross on it.

The GPS icon with a red cross on it means no GPS signals.

But I am pretty sure I got the GPS signals as my current location showed up on the official Blackberry Map App (Got a green dot that represents where I am and the GPS icon on the left top corner of the screen does not have the red cross).

And by the way, in official Blackberry Map App, everything works good (there's a green dot that represents where I am on the map and no red cross on the GPS icon at the left top corner of the screen).

The question is: How to make the GPS active with RichMapField and show my current location as a green dot on the map just like how the official Blackberry Map App does when I use the RichMapField in my app?

Below is more information: I have tried using BlackBerryLocationProvider to fetch GPS data. and it works. but that does not remove the red cross from the GPS icon on the RichMapField and the green dot (current location) does not show up. I just can change the center of the map with returned lat/longi

action.setCentre(new MapPoint(location.getQualifiedCoordinates().getLatitude(),
                              location.getQualifiedCoordinates().getLongitude()));

Do I need to add a special location listener to BlackBerryLocationProvider?

0

There are 0 answers