繁体   English   中英

模糊 map 在 Xamarin Forms Z46F3EA056CAA3126B91F3F70BEEA068C

[英]Blurred map in Xamarin Forms Map?

如何在 xamarin 中禁用模糊效果,您可以在图像上看到?

在此处输入图像描述

正如您在图像上看到的,我遇到了一个问题,即高速公路变得模糊而不是变得更清晰。 我需要知道如何将其设置得更清晰。 我可以放大和缩小,但它只是放大而不是显示更多细节。 请帮忙。

我的 AndroidManifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.companyname.freemomentapp">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="30" />
<!-- Google Maps for Android v2 requires OpenGL ES v2 -->
<uses-feature android:glEsVersion="0x00020000" android:required="true" />

<!-- Permission to receive remote notifications from Google Play Services -->
<!-- Notice here that we have the package name of our application as a prefix on the permissions. -->
<uses-permission android:name="com.companyname.freemomentapp.permission.MAPS_RECEIVE" />
<permission android:name="com.companyname.freemomentapp.permission.MAPS_RECEIVE" android:protectionLevel="signature" />

<!-- These are optional, but recommended. They will allow Maps to use the My Location provider. -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  
<application android:label="FreemomentApp.Android" android:theme="@style/MainTheme">
  <meta-data android:name="com.google.android.geo.API_KEY" android:value="<Key is removed for this question>" />
  <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
  <!-- Necessary for apps that target Android 9.0 or higher -->
  <uses-library android:name="org.apache.http.legacy" android:required="false" />
</application>

我的 MapsPage.xaml:

<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" 
         xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
         xmlns:maps="clr-namespace:Xamarin.Forms.Maps;assembly=Xamarin.Forms.Maps"
         x:Class="FreemomentApp.Views.MapsPage">
<maps:Map x:Name="map" MapClicked="OnMapClicked" />

我的 MapsPage.xml.cs:

public partial class MapsPage : ContentPage
{
    public MapsPage()
    {
        Map map = new Map();
        map.MapClicked += OnMapClicked;
        map.MoveToRegion(MapSpan.FromCenterAndRadius(new Position(53.2374847, 8.6868356), Distance.FromKilometers(1)));
        Content = map;
    }

    private void OnMapClicked(object sender, MapClickedEventArgs e)
    {
        Console.WriteLine("hallo");
        //throw new NotImplementedException();
    }
}

解决方法:更改androidManifest.xml中的api键

api 密钥似乎存在问题。 我用旧钥匙换了新钥匙,现在效果很好。 我不能告诉你,为什么它是模糊的,而不是像往常一样显示灰屏。

暂无
暂无

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

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