Xamarin Forms Map 中的模糊地图?
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 键似乎有问题。我用旧钥匙换了新钥匙,现在效果很好。我不能告诉你,为什么它是模糊的而不是像往常一样显示灰色屏幕。
如何在 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 键似乎有问题。我用旧钥匙换了新钥匙,现在效果很好。我不能告诉你,为什么它是模糊的而不是像往常一样显示灰色屏幕。