【问题标题】:android Google map API v2 doesn't display street namesandroid Google map API v2 不显示街道名称
【发布时间】:2013-06-26 04:03:15
【问题描述】:

我正在使用 google maps API v2 显示地图,但它没有显示任何街道名称。它显示卫星图像但没有文字。我在这里做错了什么?

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_gmaps);

    mLocationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
    map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();
    map.setMyLocationEnabled(true);
    map.setMapType(GoogleMap.MAP_TYPE_SATELLITE);

    map.setInfoWindowAdapter(new MyInfoWindowAdapter(this, getLayoutInflater()));
    map.setOnMapLongClickListener(this);
    map.setOnInfoWindowClickListener(this);
    map.setOnMarkerClickListener(this);

    mMyLocation = map.getMyLocation();
    setMarkerOnLocation();
}

【问题讨论】:

    标签: android google-maps


    【解决方案1】:

    这按设计工作。您正在将地图设置为卫星模式并根据https://developers.google.com/maps/documentation/android/map#map_types

    卫星

    卫星照片数据。道路和地物标签不可见

    混合

    添加了带有路线图的卫星照片数据。道路和地物标签也是可见的。

    因此,如果要显示标签,则需要使用以下内容:

    GoogleMap map;
    ...
    // Sets the map type to be "hybrid"
    map.setMapType(GoogleMap.MAP_TYPE_HYBRID);
    

    【讨论】:

      【解决方案2】:

      你刚刚给出了当前位置,没有给出任何经纬度点

      例如:

        LatLng one = new LatLng(13.549881,77.711792);//
      
        Marker myMarkerOne = gm.addMarker(new MarkerOptions()
              .position(one)
              .title("Name of location")
              .snippet("Name of street")
              .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_GREEN)));       
      

      如果你想动态获取意味着使用here给出的json映射解析。

      【讨论】:

      • 我不是指一个特定的位置。我的意思是当地图加载时,放大和缩小时它不显示任何街道名称、高速公路、建筑物等。不是通过api自动传递的吗?
      • 地图是否看起来是空白的?你能添加截图吗?你已经添加了卫星,所以它会加载街道名称。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-03-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多