xamarin谷歌地图不工作 [英] xamarin google map not working

查看:281
本文介绍了xamarin谷歌地图不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用下面的链接<创建的地图href=\"http://developer.xamarin.com/guides/android/platform_features/maps_and_location/maps/part_2_-_maps_api/\" rel=\"nofollow\">http://developer.xamarin.com/guides/android/platform_features/maps_and_location/maps/part_2_-_maps_api/我跟着它提到的所有程序,但我得到是一个空白屏幕。我的应用程序输出显示,在执行映射活动以下日志。

I created a map using the following link http://developer.xamarin.com/guides/android/platform_features/maps_and_location/maps/part_2_-_maps_api/ i followed all the procedures mentioned in it but what am getting is a blank screen. My application Output shows the following log on executing the map activity.

打开连接[请求] DRD(41):62 | 147请求]关闭[请求]错误处理:com.google.maps.api.android.lib6.bd@42a1cef8~~MD不重试[请求]重试:COM。 google.maps.api.android.lib6.c.au@429ced70

Open Connection [REQUEST] DRD(41): 62|147 [REQUEST] Close [REQUEST] Error processing: com.google.maps.api.android.lib6.b.d@42a1cef8 not retrying [REQUEST] Retrying: com.google.maps.api.android.lib6.c.au@429ced70

谁能告诉我这是为什么发生的事情。

Can anyone please tell me why this is happening.

推荐答案

由于@Miha提到这是相关的密钥。

As @Miha mentioned this is keys related.

在present你将不会得到在地图上显示的任何地图图块。

At present you will not be getting any map tiles displayed on the map.

要获得的例子在那里工作,你需要做几件事情。

To get the example to work there are several things that you need to do.

1)获得您的签名密钥指纹 SHA1 )为您的机器。

1) Obtain your Signing Key Fingerprint (SHA1) for your machine.

如果您尚未创建您的 SHA1 键为您的机器,你需要做的这第一。链接<一个href=\"http://developer.xamarin.com/guides/android/platform_features/maps_and_location/maps/obtaining_a_google_maps_api_key/\"相对=nofollow>这里介绍如何使用命令控制台来产生这一点。

If you haven't already created your SHA1 key for your machine you will need to do this first. The link here describes how to generate this using the command console.

您将获得 SHA1 键指纹作为这一结果。

You will get a SHA1 key fingerprint as a result of this.

2)获得在项目您正在使用的。

2) Obtain the package name from the project you are working on.

这可以通过看在 Android版 项目的 Android清单标签下的性能定位。然后,您将看到在包名称字段一个文本框。

This can be located by looking at the Android project properties under the Android Manifest tab. You will then see a text-box for the Package name field.

3)在谷歌开发者控制台您需要创建一个应用应你不已经有一个,和创建一个新的Andr​​oid键 (这是位于在 API和放大器; AUTH \\证书)。

3) In Google Developer Console you will need to create an Application should you not already have one, and Create A New Android key (This is located under APIs & auth \ Credentials).

在会弹出,你将能够在 SHA1 键和包名称您已经格式为 {} SHA1; {包名称}

On the screen that will pop-up you will be able to enter in the SHA1 key and Package Name that you have previously captured in the format {SHA1};{Package Name}.

那么这将返回到你的 API密钥您将在接下来的步骤中使用: -

This will then return to you the API key that you will use in the next step:-

4)在 Android项目,看看源对于的Andr​​oidManifest.xml 。您将看到以下内容: -

4) In the Android Project, look at the source for AndroidManifest.xml. You will see the following:-

<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="{some api key}" />      

输入您 API密钥中,你有pviously抓获$ P $。

Enter you API key in that you have previously captured.

5)在谷歌开发者控制台,为的项目的,你还必须要记住,你必须启用的谷歌地图的Andr​​oid API V2 谷歌Play Android开发者API 。您可以找到这些在 API和放大器; AUTH \\的API

5) In the Google Developer Console, for the project, you also have to remember that you have to enable Google Maps Android API v2 and also Google Play Android Developer API. You can find these under APIs & auth \ APIs

您应该然后,终于,能够运行演示。

You should then, finally, be able to run the demo.

更新1: -

添加使用许可权 MAPS_RECEIVE 作为@leoneboaventura也提到了,所以类似如下: -

Add the uses-permission for MAPS_RECEIVE as @leoneboaventura mentioned also, so something like the following:-

<uses-permission android:name="{your-package-name}.permission.MAPS_RECEIVE" />

这篇关于xamarin谷歌地图不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆