开发者

blackberry maps do not show correct location on the device

well frnds my code for maps works well and shows all pics and gradient paths very well on the simulator after simulating the gps ,but it does not works on the device....

The gps on device is working properly as google maps and other work related to gps are working perfectly fine

my code

         if(GPS_Location.lati!=0.0 && GPS_Location.longi!=0.0)
            {                       
                User_latitude = ((GPS_Location.lati)*100000);
                User_longitude = ((GPS_Location.longi)*100000);

                User_La = String.valueOf(User_latitude).substring(0, String.valueOf(User_latitude).lastIndexOf('.'));
                User_Lo = String.valueOf(User_longitude).substring(0, String.valueOf(User_longitude).lastIndexOf('.'));

             if(param.equals("")) //for find business near me
             {

                 document1 = "<location-document>" +
                                "<location lon='"+User_Lo+"' lat='"+User_La+"' label='User' />"+
                                "<location lon='"+User_Lo+"' lat='"+User_La+"' label='"+"User"+"' />"+
                             "</location-document>";
             }
             if(!param.equals("")) //for the directions
             {
                 Business_latitude = Double.开发者_如何转开发parseDouble(param.substring(0, param.lastIndexOf(',')));
                 Business_longitude = Double.parseDouble(param.substring(param.lastIndexOf(',')+1,param.length())); 

                 Business_latitude = Business_latitude*100000;                   
                 Business_longitude = Business_longitude*100000;

                 Business_La = String.valueOf(Business_latitude).substring(0, String.valueOf(Business_latitude).lastIndexOf('.'));                  
                 Business_Lo = String.valueOf(Business_longitude).substring(0, String.valueOf(Business_longitude).lastIndexOf('.'));

                 document1 = "<location-document>" +
                                "<GetRoute>"+
                            "<location lon='"+User_Lo+"' lat='"+User_La+"' label='User' />"+
                            "<location lon='"+Business_Lo+"' lat='"+Business_La+"' label='"+"User"+"' />"+
                            "</GetRoute>"+
                        "</location-document>";
             }
              Invoke.invokeApplication(Invoke.APP_TYPE_MAPS,new MapsArguments(MapsArguments.ARG_LOCATION_DOCUMENT,document1));
         }

this code works on simulator but not fine on device. just points a pin indicating user and nothing else

what to do????


 document1 = 

"<lbs>
<location lon='"+User_Lo+"' lat='"+User_La+"' label='User, ON'    description='User' zoom='10'/>
</lbs>";

i tried this and it worked,also i worked around my gps value and it worked!!!!!!!!!!!!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜