简体   繁体   English

Google Maps api密钥选项?

[英]Google Maps api key options?

I am working on a Cordova application and intend to use google maps, as per my understanding and the ionic maps starter example. 我正在研究Cordova应用程序并打算使用谷歌地图,根据我的理解和离子地图启动示例。 We use maps api key for web and load the maps. 我们使用map api key for web并加载地图。

Doubtful about 令人怀疑

1- Since it will be packaged in apk so I cannot restrict the api key to a specific domain. 1-因为它将被打包在apk中所以我不能将api密钥限制为特定域。 This doesn't look so good in terms of security. 这在安全性方面看起来不太好。

2- The app will be installed in devices and each of these will have the maps api key inside application, what if I have to change this api key in future? 2-该应用程序将安装在设备中,并且每个应用程序都将在应用程序内部具有地图api密钥,如果我将来必须更改此API密钥该怎么办?

If someone has already faced such challenges please suggest. 如果有人已经面临这样的挑战,请建议。

Thanks 谢谢

While Using cordova you don't require any API key for google maps to show it in webview 使用科尔多瓦虽然你不需要任何的API密钥谷歌地图,以显示它的WebView

EDIT 编辑

Just remove the API key field 只需删除API密钥字段即可

<script src="https://maps.googleapis.com/maps/api/js key=AIzaSyB16sGmIekuGIvYOfNoW9T44377IU2d2Es&sensor=true"></script>

like this 像这样

<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM