使用 Rhomobile MapView 不加载图块,仅加载灰色网格
我正在尝试使用 Rhomobile 框架 Rhodes 显示地图
我已关注 网络研讨会 和 教程 我做了完全相同的事情,但是我的地图图块没有加载到我的 Android 设备上,也没有加载到模拟器上。
我已按照此处的说明生成了 api 密钥< /a> 我得到了调试密钥: 05dXWxC1NSKgk7itJZnjJr1-AobLz3l5iN2iAWg
我将密钥添加到了我的 build.yml 中,如下所示:
android:
version: 2.1
mapping: true
apikey: 05dXWxC1NSKgk7itJZnjJr1-AobLz3l5iN2iAWg
在我的控制器中,我有以下内容:
map_params = {
:settings => {:map_type => "hybrid",:region => [@customer.lat, @customer.long, 0.2, 0.2],
:zoom_enabled => true,:scroll_enabled => true,:shows_user_location => false,
:api_key => 'Google Maps API Key'},
我尝试在显示 Google 地图 API 密钥的位置添加 apikey 但它仍然不起作用。我已阅读 对于 Android 来说有两个按键,但我只有 一。如果需要的话,我在哪里可以获得另一把钥匙?
我还在一些线程中读到,通过在android清单中将uses_permission设置为INTERNET,它已经解决了问题,但我不知道如何使用rhodes框架来做到这一点。我已将 GPS 功能添加到 build.yml 中,但我似乎找不到此框架中存在互联网功能。
我希望你能帮助我。先感谢您
I am trying to display a map using Rhomobile framework Rhodes
I have followed the webinar and tutorial
I have done exactly the same, but my map tiles are not loading on my android device nor on the emulator.
I have generated the api key following the instructions here
and I got the debug key: 05dXWxC1NSKgk7itJZnjJr1-AobLz3l5iN2iAWg
I added the key to my build.yml like this:
android:
version: 2.1
mapping: true
apikey: 05dXWxC1NSKgk7itJZnjJr1-AobLz3l5iN2iAWg
in my controller I have the following:
map_params = {
:settings => {:map_type => "hybrid",:region => [@customer.lat, @customer.long, 0.2, 0.2],
:zoom_enabled => true,:scroll_enabled => true,:shows_user_location => false,
:api_key => 'Google Maps API Key'},
I have tried adding the apikey where it says Google Maps API Key but it still doesn't work. I have read that for Android there are two keys involved, but I only have one. Where do I get the other key if this is necessary?
I have also read in some threads that by setting the uses_permission to INTERNET in the android manifest it has solved the problem, but I don't know how to do that using rhodes framework. I have added the gps capabilities to the build.yml, but I can't seem to find that a internet capability exists in this framework.
I hope you can help me out. Thank you in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,其实这不是我的 apikey 的问题。
通过删除 bin 文件夹并重新编译应用程序解决了问题......我想它所需要的只是某种干净的构建。
问题解决了!
Ok, so in fact it wasn't a problem of my apikey.
The problem was solved by deleting the bin folder and recompiling the app... I guess all it needed was some sort of a clean build.
problem solved!