作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
即使我在 Google Play 服务示例中使用 mapdemo 项目,Google map API V2 也显示黑屏
没有任何改变...
和 mMap
总是变成 null 吗?
if (mMap == null) {
// Try to obtain the map from the SupportMapFragment.
mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)) .getMap();
// Check if we were successful in obtaining the map.
if (mMap != null) {
setUpMap();
}
最佳答案
这个问题(Blank map with zoom control)通常是因为你没有正确引用 google-play-services
库,或者没有在控制台配置 API正确的方法。
您可以查看我写的关于如何在您的应用程序中集成 Google Maps API V2 的博文:
按照前 3 个步骤进行正确的 google-play-services
库集成。
或者在 API 控制台中查看此帖子以了解正确的配置:
关于Android - 谷歌地图显示空白屏幕,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16670907/
leaflet:一个开源并且对移动端友好的交互式地图 JavaScript 库 中文文档: https://leafletjs.cn/reference.html 官网(英文): ht
我是一名优秀的程序员,十分优秀!