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
Trusted Contributor
maanbhati
Posts: 236
Registered: ‎07-28-2010
My Device: Not Specified
Accepted Solution

how to show pin on bb map using 5.0 API

Hi All ,

               I am developing an application for that i am showing map and writng following code

but it is not showing Pin on that map for 5.0 API O.S level.

 

 

        MapView mapView = new MapView();
        double lat=Double.parseDouble(ifAgentSearchInfo.getLatitude())*100000;
        int latInt=(int)lat;
        double lot=Double.parseDouble(ifAgentSearchInfo.getLongitude())*100000;
        int lotInt=(int)lot;            
        mapView.setLatitude(latInt);
        mapView.setLongitude(lotInt);
        mapView.setZoom(2);


        MapsArguments mapsArgs = new MapsArguments(mapView);
        Invoke.invokeApplication(Invoke.APP_TYPE_MAPS, mapsArgs);

 

 

 

Thanks to All

Trusted Contributor
maanbhati
Posts: 236
Registered: ‎07-28-2010
My Device: Not Specified

Re: how to show pin on bb map using 5.0 API

can anyone give me the answer...............

Developer
rajeshkparmar
Posts: 104
Registered: ‎08-03-2010
My Device: Blackberry Z10

Re: how to show pin on bb map using 5.0 API

See the demo of Embeded map in Sample program of 5.0 API.

It will give the idea of hoe to display pin in Embeded MAp.

You can add more than pin in to it..

 

If not understand than reply me i will tell you..


Please mark posts as solved if you found a solution.
Feel free to press the kudos button to thank the user that helped you
Trusted Contributor
maanbhati
Posts: 236
Registered: ‎07-28-2010
My Device: Not Specified

Re: how to show pin on bb map using 5.0 API

HI Rajeshkparmar,

                                    I am not getting in embeded map demo because my code is entirely defferent as following

 

MapView mapView = new MapView();
        double lat=Double.parseDouble(ifAgentSearchInfo.getLatitude())*100000;
        int latInt=(int)lat;
        double lot=Double.parseDouble(ifAgentSearchInfo.getLongitude())*100000;
        int lotInt=(int)lot;            
        mapView.setLatitude(latInt);
        mapView.setLongitude(lotInt);
        mapView.setZoom(2);
        MapsArguments mapsArgs = new MapsArguments(mapView);
        Invoke.invokeApplication(Invoke.APP_TYPE_MAPS, mapsArgs);

 

 

above code is showing bb default map but it is not showing pin on that map

 

 

Thanks       

 

 

Developer
rajeshkparmar
Posts: 104
Registered: ‎08-03-2010
My Device: Blackberry Z10

Re: how to show pin on bb map using 5.0 API

hi,

It seems like you are using inbulit Map by passing argument..

 

String document1 = "<lbs clear='Locations'>" + "<location x='"
                        + lon1 + "' y='" + lat1   />"
                        + "</lbs>";
                Invoke.invokeApplication(Invoke.APP_TYPE_MAPS,
                        new MapsArguments(MapsArguments.ARG_LOCATION_DOCUMENT,
                                document1));

 

Used lat1 lon1 as you Lat Lon..

 

Regards

Rajesh Parmar


Please mark posts as solved if you found a solution.
Feel free to press the kudos button to thank the user that helped you
Trusted Contributor
maanbhati
Posts: 236
Registered: ‎07-28-2010
My Device: Not Specified

Re: how to show pin on bb map using 5.0 API

hi  Rajesh i got the solution for this but one more thinf i want to ask you,

how to display more than 2 (e.g- 10-20) pins on bb default map, whose lat , long values are coming from server

i am using GetRoute tag from XML  nad passing that in mapargument

 

 

 

Thanks  & Regards

Mansingh

Developer
rajeshkparmar
Posts: 104
Registered: ‎08-03-2010
My Device: Blackberry Z10

Re: how to show pin on bb map using 5.0 API

add more location in String

 

like this

 

"<location lat='-7569792' lon='4542349' address='Ottawa, ON, CANADA'/>"
+ "<location lat='-7938675' lon='4367022' address='Toronto, ON, CANADA'/>"

 

 


Please mark posts as solved if you found a solution.
Feel free to press the kudos button to thank the user that helped you
Developer
welsenKiriono
Posts: 202
Registered: ‎04-19-2011
My Device: Blackberry Bold 9780

Re: how to show pin on bb map using 5.0 API

Sorry, if i'm posting here..

But, i want to ask about invoke blackberry maps too

How to set default zoom in lbs documet..

Also, i want to set the first location to be centered in blackberry maps..

 

Sorry if my english language is poor...

Thanx