黑莓地图未在设备上显示正确的位置

时间:2010-04-30 13:50:13

标签: blackberry maps

我的地图代码很好,并且在模拟gps后在模拟器上很好地显示了所有图片和渐变路径,但它在设备上不起作用....

设备上的gps工作正常,谷歌地图和其他与gps相关的工作完全正常

我的代码

         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));
         }

此代码适用于模拟器但在设备上不正常。 只是指出一个指示用户的引脚

怎么做????

1 个答案:

答案 0 :(得分:0)

 document1 = 

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

我尝试了这个并且它有效,我也在我的gps值工作,它工作!!!!!!!!!!!!