使用 Rhomobile MapView 不加载图块,仅加载灰色网格

发布于 2024-12-02 17:36:29 字数 1374 浏览 2 评论 0原文

我正在尝试使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦境 2024-12-09 17:36:29

好吧,其实这不是我的 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!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文