android - 谷歌静态地图 API url 在 android 中不起作用
问题描述
我们在我们的 ionic 应用程序中使用静态谷歌地图 url,该应用程序在 IOS 中运行良好,但在 android 中无法运行。我们将 API 密钥与 URL 一起附加,并且该 URL 在桌面浏览器和 iOS 设备上工作。但它不适用于 android 设备并显示空白(白色)空间。我在 home.scss 下面有以下代码
testmap-image {
.mapcontainer {
position: relative;
img-loader {
width: 100%;
height: 100px;
background-repeat: no-repeat;
background-position: center;
background-size: cover;
ion-spinner {
height: 100px;
}
}
}
}
主页.html
<div class="map-container">
<img-loader *ngIf="getUrl"
[src]="getUrl"
width="100%"
height="100px"
backgroundSize="cover"
backgroundPosition="center"
>
</img-loader>
</div>
在上面的代码中,我从 getUrl() 方法获得了正确的 URL。
网址是: https://maps.googleapis.com/maps/api/staticmap?center=,22 , market street, mumbai,India&zoom=15&size=650x150&key=xxxxxxxxxxxxxxxxxxxxx
您能否让我知道可能是什么问题以及为什么它无法在 android 设备上运行?
问候
解决方案
推荐阅读
- python - 我正在尝试为学校制作一个加密程序,但实际上用我的特殊字符替换字母数字时遇到了麻烦
- javascript - 我正在尝试制作一个事件侦听器,当您单击图像时它会显示一个 div
- postgresql - Postgres 连接在内部网络上超时,而不是在外部网络上
- ansible - Ansible - 如何获取列表的第一列?
- graphql - 通过声明式编程实现 GraphQL Schema 委托
- python - 更改后 Django 服务器不会重新启动
- node.js - express-session cookie.domain 不起作用
- ios - 如何使背景闪烁或连续闪烁,直到再次按下按钮,然后它会闪烁或闪烁 2 种新的随机颜色
- python - 散景 - 双轴,均为对数刻度
- mapbox - 获取 TypeError:当我从 Context React 调用地图时,mapa.flyTo 不是函数