zoukankan      html  css  js  c++  java
  • 获得经纬度

    //导入百度地图 
    1
    private void initBaiDuInfo() { 2 mLocationClient = new LocationClient(getApplicationContext()); 3 setLocationOption(); 4 mLocationClient.registerLocationListener(myListener); 5 mLocationClient.start(); 6 } 7 8 private class MyLocationListenner implements BDLocationListener { 9 @Override 10 public void onReceiveLocation(BDLocation location) { 11 System.out.println("onReceiveLocation"); 12 // if (null != location.getCity()) { 13 // LocalCity = location.getCity().substring(0, 14 // location.getCity().lastIndexOf("市")); 15 // System.out.println("LocalCity:"+LocalCity); 16 // new SharedPClass("LocalCity", LocalCity, 17 // PeopleActivity.this); 18 // } 19 if(location != null){ 20 latitude = location.getLatitude(); 21 longitude = location.getLongitude(); 22 23 initViewLVDataToDisplay(); 24 mLocationClient.stop(); 25 } 26 27 private void setLocationOption() { 28 LocationClientOption option = new LocationClientOption(); 29 option.setLocationNotify(true); 30 option.setOpenGps(true); 31 option.setIsNeedAddress(true); 32 option.setCoorType("bd09ll"); // 设置返回值的坐标类型 33 option.setLocationMode(LocationMode.Hight_Accuracy); 34 option.setTimeOut(30 * 1000); 35 mLocationClient.setLocOption(option); 36 }
  • 相关阅读:
    CSS书写规范参考
    CSS实现垂直居中的5种方法
    HTML5新标签
    sublime win10下中文输入框自动跟随解决
    变量更改值
    查看文件
    list copy
    Tomcat JAR包冲突报错
    第一周单元3:Requests库网络爬虫实例-查询ip地址
    .strip()的喵用!
  • 原文地址:https://www.cnblogs.com/annieBaby/p/4782931.html
Copyright © 2011-2022 走看看