【问题标题】:My App not loading Google map我的应用没有加载谷歌地图
【发布时间】:2014-11-01 12:58:30
【问题描述】:

我正在使用此代码加载谷歌地图 私人谷歌地图我的地图;

if(myMap!=null){
            myMap.setMyLocationEnabled(true);
            myMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
            marker = myMap.addMarker(new MarkerOptions().position(new LatLng(latitude, longitude)).title(getAddress(latitude, longitude)));
            Location = new LatLng(latitude, longitude);
            CameraPosition cameraPosition = new CameraPosition.Builder().target(Location).zoom(15) 
                    .bearing(90) // Sets the orientation of the camera to
                    .tilt(30) // Sets the tilt of the camera to 30 degrees
                    .build(); // Creates a CameraPosition from the builder
            // myMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
            myMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(latitude, longitude), 15));
            }

但地图未加载并出现此问题

【问题讨论】:

标签: android google-maps


【解决方案1】:

在运行应用之前,您必须在手机/标签/模拟器中安装最新的 Google Play 服务。

For google play on emulator.

【讨论】:

  • 正确,可以通过 Google Play 商店安装,前提是该商店在平板电脑上可用。
  • @amalBit 现在我已经在我的手机中安装了 google play 服务。但谷歌地图显示为空屏。
  • 空的谷歌地图意味着你做的每一件事都是正确的,只需要检查几件事。 1.你有网络吗? 2.您的google API key可能没有正确注册。
猜你喜欢
  • 2021-01-20
  • 2013-07-03
  • 2018-09-14
  • 1970-01-01
  • 1970-01-01
  • 2017-08-14
  • 1970-01-01
相关资源
最近更新 更多