Archive map circle custom renderer.
|
@ -0,0 +1,19 @@
|
|||
Any raw assets you want to be deployed with your application can be placed in
|
||||
this directory (and child directories) and given a Build Action of "AndroidAsset".
|
||||
|
||||
These files will be deployed with your package and will be accessible using Android's
|
||||
AssetManager, like this:
|
||||
|
||||
public class ReadAsset : Activity
|
||||
{
|
||||
protected override void OnCreate (Bundle bundle)
|
||||
{
|
||||
base.OnCreate (bundle);
|
||||
|
||||
InputStream input = Assets.Open ("my_asset.txt");
|
||||
}
|
||||
}
|
||||
|
||||
Additionally, some Android functions will automatically load asset files:
|
||||
|
||||
Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
|
|
@ -0,0 +1,49 @@
|
|||
using Android.Content;
|
||||
using Android.Gms.Maps.Model;
|
||||
using MapOverlay;
|
||||
using MapOverlay.Droid;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Maps.Android;
|
||||
|
||||
[assembly: ExportRenderer(typeof(CustomMap), typeof(CustomMapRenderer))]
|
||||
namespace MapOverlay.Droid
|
||||
{
|
||||
public class CustomMapRenderer : MapRenderer
|
||||
{
|
||||
CustomCircle circle;
|
||||
|
||||
public CustomMapRenderer(Context context) : base(context)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnElementChanged(Xamarin.Forms.Platform.Android.ElementChangedEventArgs<Xamarin.Forms.Maps.Map> e)
|
||||
{
|
||||
base.OnElementChanged(e);
|
||||
|
||||
if (e.OldElement != null)
|
||||
{
|
||||
// Unsubscribe
|
||||
}
|
||||
|
||||
if (e.NewElement != null)
|
||||
{
|
||||
var formsMap = (CustomMap)e.NewElement;
|
||||
circle = formsMap.Circle;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnMapReady(Android.Gms.Maps.GoogleMap map)
|
||||
{
|
||||
base.OnMapReady(map);
|
||||
|
||||
var circleOptions = new CircleOptions();
|
||||
circleOptions.InvokeCenter(new LatLng(circle.Position.Latitude, circle.Position.Longitude));
|
||||
circleOptions.InvokeRadius(circle.Radius);
|
||||
circleOptions.InvokeFillColor(0X66FF0000);
|
||||
circleOptions.InvokeStrokeColor(0X66FF0000);
|
||||
circleOptions.InvokeStrokeWidth(0);
|
||||
|
||||
NativeMap.AddCircle(circleOptions);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
using System;
|
||||
using Android.App;
|
||||
using Android.Content.PM;
|
||||
using Android.OS;
|
||||
|
||||
namespace MapOverlay.Droid
|
||||
{
|
||||
[Activity (Label = "MapOverlay.Droid", Icon = "@drawable/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
|
||||
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
|
||||
{
|
||||
protected override void OnCreate (Bundle bundle)
|
||||
{
|
||||
base.OnCreate (bundle);
|
||||
|
||||
global::Xamarin.Forms.Forms.Init (this, bundle);
|
||||
Xamarin.FormsMaps.Init (this, bundle);
|
||||
|
||||
var width = Resources.DisplayMetrics.WidthPixels;
|
||||
var height = Resources.DisplayMetrics.HeightPixels;
|
||||
var density = Resources.DisplayMetrics.Density;
|
||||
|
||||
App.ScreenWidth = (width - 0.5f) / density;
|
||||
App.ScreenHeight = (height - 0.5f) / density;
|
||||
|
||||
LoadApplication (new App ());
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,87 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<ProjectGuid>{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>MapOverlay.Droid</RootNamespace>
|
||||
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
|
||||
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
|
||||
<AndroidResgenClass>Resource</AndroidResgenClass>
|
||||
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
|
||||
<AndroidApplication>True</AndroidApplication>
|
||||
<AssemblyName>MapOverlay.Droid</AssemblyName>
|
||||
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
|
||||
<TargetFrameworkVersion>v9.0</TargetFrameworkVersion>
|
||||
<JavaMaximumHeapSize>1G</JavaMaximumHeapSize>
|
||||
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
|
||||
<NuGetPackageImportStamp />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>portable</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AndroidLinkMode>None</AndroidLinkMode>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<AndroidEnableMultiDex>true</AndroidEnableMultiDex>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>portable</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Xamarin.Forms" Version="4.5.0.356" />
|
||||
<PackageReference Include="Xamarin.Forms.Maps" Version="4.5.0.356" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="Mono.Android" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\MapOverlay\MapOverlay.csproj">
|
||||
<Project>{61E6D969-58D3-47D8-B653-410B26EE1FE6}</Project>
|
||||
<Name>MapOverlay</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="MainActivity.cs" />
|
||||
<Compile Include="Resources\Resource.designer.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="CustomMapRenderer.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\AboutResources.txt" />
|
||||
<None Include="Properties\AndroidManifest.xml" />
|
||||
<None Include="Assets\AboutAssets.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Resources\layout\" />
|
||||
<Folder Include="Resources\values\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable\icon.png" />
|
||||
<AndroidResource Include="Resources\drawable-hdpi\icon.png" />
|
||||
<AndroidResource Include="Resources\drawable-xhdpi\icon.png" />
|
||||
<AndroidResource Include="Resources\drawable-xxhdpi\icon.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\layout\Tabbar.axml" />
|
||||
<AndroidResource Include="Resources\layout\Toolbar.axml" />
|
||||
<AndroidResource Include="Resources\values\styles.xml" />
|
||||
<AndroidResource Include="Resources\values\colors.xml" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
|
||||
</Project>
|
|
@ -0,0 +1,16 @@
|
|||
<?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.mapoverlay">
|
||||
<uses-sdk android:minSdkVersion="19" />
|
||||
<application android:label="MapOverlay">
|
||||
<meta-data android:name="com.google.android.geo.API_KEY" android:value="INSERT_MAP_API_KEY_HERE" />
|
||||
<!-- Necessary for apps that target Android 9.0 or higher -->
|
||||
<uses-library android:name="org.apache.http.legacy" android:required="false" />
|
||||
</application>
|
||||
<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_LOCATION_EXTRA_COMMANDS" />
|
||||
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
</manifest>
|
|
@ -0,0 +1,28 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Android.App;
|
||||
|
||||
// Information about this assembly is defined by the following attributes.
|
||||
// Change them to the values specific to your project.
|
||||
|
||||
[assembly: AssemblyTitle ("MapOverlay.Droid")]
|
||||
[assembly: AssemblyDescription ("")]
|
||||
[assembly: AssemblyConfiguration ("")]
|
||||
[assembly: AssemblyCompany ("")]
|
||||
[assembly: AssemblyProduct ("")]
|
||||
[assembly: AssemblyCopyright ("davidbritch")]
|
||||
[assembly: AssemblyTrademark ("")]
|
||||
[assembly: AssemblyCulture ("")]
|
||||
|
||||
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
|
||||
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
|
||||
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
|
||||
|
||||
[assembly: AssemblyVersion ("1.0.0")]
|
||||
|
||||
// The following attributes are used to specify the signing key for the assembly,
|
||||
// if desired. See the Mono documentation for more information about signing.
|
||||
|
||||
//[assembly: AssemblyDelaySign(false)]
|
||||
//[assembly: AssemblyKeyFile("")]
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
Images, layout descriptions, binary blobs and string dictionaries can be included
|
||||
in your application as resource files. Various Android APIs are designed to
|
||||
operate on the resource IDs instead of dealing with images, strings or binary blobs
|
||||
directly.
|
||||
|
||||
For example, a sample Android app that contains a user interface layout (main.axml),
|
||||
an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
|
||||
would keep its resources in the "Resources" directory of the application:
|
||||
|
||||
Resources/
|
||||
drawable/
|
||||
icon.png
|
||||
|
||||
layout/
|
||||
main.axml
|
||||
|
||||
values/
|
||||
strings.xml
|
||||
|
||||
In order to get the build system to recognize Android resources, set the build action to
|
||||
"AndroidResource". The native Android APIs do not operate directly with filenames, but
|
||||
instead operate on resource IDs. When you compile an Android application that uses resources,
|
||||
the build system will package the resources for distribution and generate a class called "R"
|
||||
(this is an Android convention) that contains the tokens for each one of the resources
|
||||
included. For example, for the above Resources layout, this is what the R class would expose:
|
||||
|
||||
public class R {
|
||||
public class drawable {
|
||||
public const int icon = 0x123;
|
||||
}
|
||||
|
||||
public class layout {
|
||||
public const int main = 0x456;
|
||||
}
|
||||
|
||||
public class strings {
|
||||
public const int first_string = 0xabc;
|
||||
public const int second_string = 0xbcd;
|
||||
}
|
||||
}
|
||||
|
||||
You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main
|
||||
to reference the layout/main.axml file, or R.strings.first_string to reference the first
|
||||
string in the dictionary file values/strings.xml.
|
После Ширина: | Высота: | Размер: 1.4 KiB |
После Ширина: | Высота: | Размер: 1.7 KiB |
После Ширина: | Высота: | Размер: 2.3 KiB |
После Ширина: | Высота: | Размер: 1.4 KiB |
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.design.widget.TabLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/sliding_tabs"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
|
||||
app:tabIndicatorColor="@android:color/white"
|
||||
app:tabGravity="fill"
|
||||
app:tabMode="fixed" />
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<android.support.v7.widget.Toolbar
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
|
||||
android:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="launcher_background">#FFFFFF</color>
|
||||
<color name="colorPrimary">#3F51B5</color>
|
||||
<color name="colorPrimaryDark">#303F9F</color>
|
||||
<color name="colorAccent">#FF4081</color>
|
||||
</resources>
|
|
@ -0,0 +1,27 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="MainTheme" parent="MainTheme.Base">
|
||||
</style>
|
||||
<!-- Base theme applied no matter what API -->
|
||||
<style name="MainTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||
<!--If you are using revision 22.1 please use just windowNoTitle. Without android:-->
|
||||
<item name="windowNoTitle">true</item>
|
||||
<!--We will be using the toolbar so no need to show ActionBar-->
|
||||
<item name="windowActionBar">false</item>
|
||||
<!-- Set theme colors from http://www.google.com/design/spec/style/color.html#color-color-palette -->
|
||||
<!-- colorPrimary is used for the default action bar background -->
|
||||
<item name="colorPrimary">#2196F3</item>
|
||||
<!-- colorPrimaryDark is used for the status bar -->
|
||||
<item name="colorPrimaryDark">#1976D2</item>
|
||||
<!-- colorAccent is used as the default value for colorControlActivated
|
||||
which is used to tint widgets -->
|
||||
<item name="colorAccent">#FF4081</item>
|
||||
<!-- You can also set colorControlNormal, colorControlActivated
|
||||
colorControlHighlight and colorSwitchThumbNormal. -->
|
||||
<item name="windowActionModeOverlay">true</item>
|
||||
<item name="android:datePickerDialogTheme">@style/AppCompatDialogStyle</item>
|
||||
</style>
|
||||
<style name="AppCompatDialogStyle" parent="Theme.AppCompat.Light.Dialog">
|
||||
<item name="colorAccent">#FF4081</item>
|
||||
</style>
|
||||
</resources>
|
|
@ -0,0 +1,334 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.24720.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MapOverlay", "MapOverlay\MapOverlay.csproj", "{61E6D969-58D3-47D8-B653-410B26EE1FE6}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MapOverlay.iOS", "iOS\MapOverlay.iOS.csproj", "{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MapOverlay.Droid", "Droid\MapOverlay.Droid.csproj", "{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MapOverlay.UWP", "UWP\MapOverlay.UWP.csproj", "{17A70047-76FD-485F-91E4-9D68A8490277}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Ad-Hoc|Any CPU = Ad-Hoc|Any CPU
|
||||
Ad-Hoc|ARM = Ad-Hoc|ARM
|
||||
Ad-Hoc|iPhone = Ad-Hoc|iPhone
|
||||
Ad-Hoc|iPhoneSimulator = Ad-Hoc|iPhoneSimulator
|
||||
Ad-Hoc|x64 = Ad-Hoc|x64
|
||||
Ad-Hoc|x86 = Ad-Hoc|x86
|
||||
AppStore|Any CPU = AppStore|Any CPU
|
||||
AppStore|ARM = AppStore|ARM
|
||||
AppStore|iPhone = AppStore|iPhone
|
||||
AppStore|iPhoneSimulator = AppStore|iPhoneSimulator
|
||||
AppStore|x64 = AppStore|x64
|
||||
AppStore|x86 = AppStore|x86
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|ARM = Debug|ARM
|
||||
Debug|iPhone = Debug|iPhone
|
||||
Debug|iPhoneSimulator = Debug|iPhoneSimulator
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|ARM = Release|ARM
|
||||
Release|iPhone = Release|iPhone
|
||||
Release|iPhoneSimulator = Release|iPhoneSimulator
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Ad-Hoc|Any CPU.Deploy.0 = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Ad-Hoc|ARM.Deploy.0 = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Ad-Hoc|iPhone.Deploy.0 = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Ad-Hoc|iPhoneSimulator.Deploy.0 = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Ad-Hoc|x64.Build.0 = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Ad-Hoc|x64.Deploy.0 = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Ad-Hoc|x86.Build.0 = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Ad-Hoc|x86.Deploy.0 = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.AppStore|Any CPU.Build.0 = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.AppStore|Any CPU.Deploy.0 = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.AppStore|ARM.ActiveCfg = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.AppStore|ARM.Build.0 = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.AppStore|ARM.Deploy.0 = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.AppStore|iPhone.Build.0 = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.AppStore|iPhone.Deploy.0 = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.AppStore|iPhoneSimulator.Deploy.0 = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.AppStore|x64.ActiveCfg = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.AppStore|x64.Build.0 = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.AppStore|x64.Deploy.0 = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.AppStore|x86.ActiveCfg = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.AppStore|x86.Build.0 = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.AppStore|x86.Deploy.0 = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Debug|ARM.ActiveCfg = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Debug|ARM.Build.0 = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Debug|ARM.Deploy.0 = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Debug|iPhone.ActiveCfg = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Debug|iPhone.Build.0 = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Debug|iPhone.Deploy.0 = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Debug|iPhoneSimulator.Deploy.0 = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Debug|x64.Deploy.0 = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Debug|x86.Deploy.0 = Debug|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Release|Any CPU.Deploy.0 = Release|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Release|ARM.ActiveCfg = Release|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Release|ARM.Build.0 = Release|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Release|ARM.Deploy.0 = Release|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Release|iPhone.ActiveCfg = Release|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Release|iPhone.Build.0 = Release|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Release|iPhone.Deploy.0 = Release|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Release|iPhoneSimulator.Deploy.0 = Release|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Release|x64.Build.0 = Release|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Release|x64.Deploy.0 = Release|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Release|x86.Build.0 = Release|Any CPU
|
||||
{61E6D969-58D3-47D8-B653-410B26EE1FE6}.Release|x86.Deploy.0 = Release|Any CPU
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Ad-Hoc|Any CPU.ActiveCfg = Ad-Hoc|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Ad-Hoc|Any CPU.Build.0 = Ad-Hoc|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Ad-Hoc|Any CPU.Deploy.0 = Ad-Hoc|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Ad-Hoc|ARM.ActiveCfg = Ad-Hoc|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Ad-Hoc|ARM.Build.0 = Ad-Hoc|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Ad-Hoc|ARM.Deploy.0 = Ad-Hoc|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Ad-Hoc|iPhone.ActiveCfg = Ad-Hoc|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Ad-Hoc|iPhone.Build.0 = Ad-Hoc|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Ad-Hoc|iPhone.Deploy.0 = Ad-Hoc|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Ad-Hoc|iPhoneSimulator
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Ad-Hoc|iPhoneSimulator.Build.0 = Ad-Hoc|iPhoneSimulator
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Ad-Hoc|iPhoneSimulator.Deploy.0 = Ad-Hoc|iPhoneSimulator
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Ad-Hoc|x64.ActiveCfg = Ad-Hoc|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Ad-Hoc|x64.Build.0 = Ad-Hoc|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Ad-Hoc|x64.Deploy.0 = Ad-Hoc|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Ad-Hoc|x86.ActiveCfg = Ad-Hoc|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Ad-Hoc|x86.Build.0 = Ad-Hoc|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Ad-Hoc|x86.Deploy.0 = Ad-Hoc|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.AppStore|Any CPU.ActiveCfg = AppStore|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.AppStore|Any CPU.Build.0 = AppStore|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.AppStore|Any CPU.Deploy.0 = AppStore|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.AppStore|ARM.ActiveCfg = AppStore|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.AppStore|ARM.Build.0 = AppStore|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.AppStore|ARM.Deploy.0 = AppStore|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.AppStore|iPhone.ActiveCfg = AppStore|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.AppStore|iPhone.Build.0 = AppStore|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.AppStore|iPhone.Deploy.0 = AppStore|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.AppStore|iPhoneSimulator.ActiveCfg = AppStore|iPhoneSimulator
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.AppStore|iPhoneSimulator.Build.0 = AppStore|iPhoneSimulator
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.AppStore|iPhoneSimulator.Deploy.0 = AppStore|iPhoneSimulator
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.AppStore|x64.ActiveCfg = AppStore|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.AppStore|x64.Build.0 = AppStore|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.AppStore|x64.Deploy.0 = AppStore|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.AppStore|x86.ActiveCfg = AppStore|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.AppStore|x86.Build.0 = AppStore|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.AppStore|x86.Deploy.0 = AppStore|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Debug|Any CPU.Deploy.0 = Debug|iPhoneSimulator
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Debug|ARM.ActiveCfg = Debug|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Debug|ARM.Build.0 = Debug|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Debug|ARM.Deploy.0 = Debug|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Debug|iPhone.ActiveCfg = Debug|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Debug|iPhone.Build.0 = Debug|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Debug|iPhone.Deploy.0 = Debug|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Debug|iPhoneSimulator.Deploy.0 = Debug|iPhoneSimulator
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Debug|x64.ActiveCfg = Debug|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Debug|x64.Build.0 = Debug|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Debug|x64.Deploy.0 = Debug|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Debug|x86.ActiveCfg = Debug|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Debug|x86.Build.0 = Debug|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Debug|x86.Deploy.0 = Debug|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Release|Any CPU.ActiveCfg = Release|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Release|Any CPU.Build.0 = Release|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Release|Any CPU.Deploy.0 = Release|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Release|ARM.ActiveCfg = Release|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Release|ARM.Build.0 = Release|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Release|ARM.Deploy.0 = Release|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Release|iPhone.ActiveCfg = Release|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Release|iPhone.Build.0 = Release|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Release|iPhone.Deploy.0 = Release|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Release|iPhoneSimulator.Deploy.0 = Release|iPhoneSimulator
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Release|x64.ActiveCfg = Release|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Release|x64.Build.0 = Release|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Release|x64.Deploy.0 = Release|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Release|x86.ActiveCfg = Release|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Release|x86.Build.0 = Release|iPhone
|
||||
{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}.Release|x86.Deploy.0 = Release|iPhone
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Ad-Hoc|Any CPU.Deploy.0 = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Ad-Hoc|ARM.ActiveCfg = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Ad-Hoc|ARM.Build.0 = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Ad-Hoc|ARM.Deploy.0 = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Ad-Hoc|iPhone.Deploy.0 = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Ad-Hoc|iPhoneSimulator.Deploy.0 = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Ad-Hoc|x64.ActiveCfg = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Ad-Hoc|x64.Build.0 = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Ad-Hoc|x64.Deploy.0 = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Ad-Hoc|x86.ActiveCfg = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Ad-Hoc|x86.Build.0 = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Ad-Hoc|x86.Deploy.0 = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.AppStore|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.AppStore|Any CPU.Build.0 = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.AppStore|Any CPU.Deploy.0 = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.AppStore|ARM.ActiveCfg = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.AppStore|ARM.Build.0 = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.AppStore|ARM.Deploy.0 = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.AppStore|iPhone.ActiveCfg = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.AppStore|iPhone.Build.0 = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.AppStore|iPhone.Deploy.0 = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.AppStore|iPhoneSimulator.Deploy.0 = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.AppStore|x64.ActiveCfg = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.AppStore|x64.Build.0 = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.AppStore|x64.Deploy.0 = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.AppStore|x86.ActiveCfg = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.AppStore|x86.Build.0 = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.AppStore|x86.Deploy.0 = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Debug|ARM.ActiveCfg = Debug|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Debug|ARM.Build.0 = Debug|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Debug|ARM.Deploy.0 = Debug|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Debug|iPhone.ActiveCfg = Debug|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Debug|iPhone.Build.0 = Debug|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Debug|iPhone.Deploy.0 = Debug|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Debug|iPhoneSimulator.Deploy.0 = Debug|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Debug|x64.Deploy.0 = Debug|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Debug|x86.Deploy.0 = Debug|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Release|Any CPU.Deploy.0 = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Release|ARM.ActiveCfg = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Release|ARM.Build.0 = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Release|ARM.Deploy.0 = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Release|iPhone.ActiveCfg = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Release|iPhone.Build.0 = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Release|iPhone.Deploy.0 = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Release|iPhoneSimulator.Deploy.0 = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Release|x64.Build.0 = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Release|x64.Deploy.0 = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Release|x86.Build.0 = Release|Any CPU
|
||||
{DA7FB1AE-A0D7-40FB-B5A5-852E3A7B93F1}.Release|x86.Deploy.0 = Release|Any CPU
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Ad-Hoc|Any CPU.ActiveCfg = Release|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Ad-Hoc|Any CPU.Build.0 = Release|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Ad-Hoc|Any CPU.Deploy.0 = Release|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Ad-Hoc|ARM.ActiveCfg = Release|ARM
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Ad-Hoc|ARM.Build.0 = Release|ARM
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Ad-Hoc|ARM.Deploy.0 = Release|ARM
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Ad-Hoc|iPhone.ActiveCfg = Release|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Ad-Hoc|iPhone.Build.0 = Release|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Ad-Hoc|iPhone.Deploy.0 = Release|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Ad-Hoc|iPhoneSimulator.Deploy.0 = Release|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Ad-Hoc|x64.ActiveCfg = Release|x64
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Ad-Hoc|x64.Build.0 = Release|x64
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Ad-Hoc|x64.Deploy.0 = Release|x64
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Ad-Hoc|x86.ActiveCfg = Release|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Ad-Hoc|x86.Build.0 = Release|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Ad-Hoc|x86.Deploy.0 = Release|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.AppStore|Any CPU.ActiveCfg = Release|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.AppStore|Any CPU.Build.0 = Release|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.AppStore|Any CPU.Deploy.0 = Release|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.AppStore|ARM.ActiveCfg = Release|ARM
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.AppStore|ARM.Build.0 = Release|ARM
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.AppStore|ARM.Deploy.0 = Release|ARM
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.AppStore|iPhone.ActiveCfg = Release|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.AppStore|iPhone.Build.0 = Release|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.AppStore|iPhone.Deploy.0 = Release|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.AppStore|iPhoneSimulator.ActiveCfg = Release|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.AppStore|iPhoneSimulator.Build.0 = Release|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.AppStore|iPhoneSimulator.Deploy.0 = Release|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.AppStore|x64.ActiveCfg = Release|x64
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.AppStore|x64.Build.0 = Release|x64
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.AppStore|x64.Deploy.0 = Release|x64
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.AppStore|x86.ActiveCfg = Release|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.AppStore|x86.Build.0 = Release|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.AppStore|x86.Deploy.0 = Release|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Debug|Any CPU.Build.0 = Debug|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Debug|Any CPU.Deploy.0 = Debug|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Debug|ARM.Deploy.0 = Debug|ARM
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Debug|iPhone.ActiveCfg = Debug|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Debug|iPhone.Build.0 = Debug|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Debug|iPhone.Deploy.0 = Debug|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Debug|iPhoneSimulator.ActiveCfg = Debug|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Debug|iPhoneSimulator.Build.0 = Debug|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Debug|iPhoneSimulator.Deploy.0 = Debug|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Debug|x64.Build.0 = Debug|x64
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Debug|x64.Deploy.0 = Debug|x64
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Debug|x86.Build.0 = Debug|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Debug|x86.Deploy.0 = Debug|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Release|Any CPU.ActiveCfg = Release|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Release|Any CPU.Build.0 = Release|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Release|Any CPU.Deploy.0 = Release|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Release|ARM.Build.0 = Release|ARM
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Release|ARM.Deploy.0 = Release|ARM
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Release|iPhone.ActiveCfg = Release|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Release|iPhone.Build.0 = Release|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Release|iPhone.Deploy.0 = Release|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Release|iPhoneSimulator.ActiveCfg = Release|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Release|iPhoneSimulator.Build.0 = Release|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Release|iPhoneSimulator.Deploy.0 = Release|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Release|x64.ActiveCfg = Release|x64
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Release|x64.Build.0 = Release|x64
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Release|x64.Deploy.0 = Release|x64
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Release|x86.ActiveCfg = Release|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Release|x86.Build.0 = Release|x86
|
||||
{17A70047-76FD-485F-91E4-9D68A8490277}.Release|x86.Deploy.0 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,31 @@
|
|||
using Xamarin.Forms;
|
||||
|
||||
namespace MapOverlay
|
||||
{
|
||||
public class App : Application
|
||||
{
|
||||
public static double ScreenHeight;
|
||||
public static double ScreenWidth;
|
||||
|
||||
public App ()
|
||||
{
|
||||
MainPage = new MapPage ();
|
||||
}
|
||||
|
||||
protected override void OnStart ()
|
||||
{
|
||||
// Handle when your app starts
|
||||
}
|
||||
|
||||
protected override void OnSleep ()
|
||||
{
|
||||
// Handle when your app sleeps
|
||||
}
|
||||
|
||||
protected override void OnResume ()
|
||||
{
|
||||
// Handle when your app resumes
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
using Xamarin.Forms.Maps;
|
||||
|
||||
namespace MapOverlay
|
||||
{
|
||||
public class CustomCircle
|
||||
{
|
||||
public Position Position { get; set; }
|
||||
|
||||
public double Radius { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
using Xamarin.Forms.Maps;
|
||||
|
||||
namespace MapOverlay
|
||||
{
|
||||
public class CustomMap : Map
|
||||
{
|
||||
public CustomCircle Circle { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugType>full</DebugType>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Xamarin.Forms" Version="4.5.0.356" />
|
||||
<PackageReference Include="Xamarin.Forms.Maps" Version="4.5.0.356" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Update="MapPage.xaml">
|
||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
|
@ -0,0 +1,9 @@
|
|||
<?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:local="clr-namespace:MapOverlay;assembly=MapOverlay"
|
||||
x:Class="MapOverlay.MapPage">
|
||||
<ContentPage.Content>
|
||||
<local:CustomMap x:Name="customMap" MapType="Street" WidthRequest="{x:Static local:App.ScreenWidth}" HeightRequest="{x:Static local:App.ScreenHeight}" />
|
||||
</ContentPage.Content>
|
||||
</ContentPage>
|
|
@ -0,0 +1,29 @@
|
|||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Maps;
|
||||
|
||||
namespace MapOverlay
|
||||
{
|
||||
public partial class MapPage : ContentPage
|
||||
{
|
||||
public MapPage ()
|
||||
{
|
||||
InitializeComponent ();
|
||||
|
||||
var pin = new Pin {
|
||||
Type = PinType.Place,
|
||||
Position = new Position (37.79752, -122.40183),
|
||||
Label = "Xamarin San Francisco Office",
|
||||
Address = "394 Pacific Ave, San Francisco CA"
|
||||
};
|
||||
|
||||
var position = new Position (37.79752, -122.40183);
|
||||
customMap.Circle = new CustomCircle {
|
||||
Position = position,
|
||||
Radius = 1000
|
||||
};
|
||||
|
||||
customMap.Pins.Add (pin);
|
||||
customMap.MoveToRegion (MapSpan.FromCenterAndRadius (position, Distance.FromMiles (1.0)));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Maps;
|
||||
|
||||
namespace MapOverlay
|
||||
{
|
||||
public class MapPageCS : ContentPage
|
||||
{
|
||||
public MapPageCS ()
|
||||
{
|
||||
var customMap = new CustomMap {
|
||||
MapType = MapType.Street,
|
||||
WidthRequest = App.ScreenWidth,
|
||||
HeightRequest = App.ScreenHeight
|
||||
};
|
||||
|
||||
var pin = new Pin {
|
||||
Type = PinType.Place,
|
||||
Position = new Position (37.79752, -122.40183),
|
||||
Label = "Xamarin San Francisco Office",
|
||||
Address = "394 Pacific Ave, San Francisco CA"
|
||||
};
|
||||
|
||||
var position = new Position (37.79752, -122.40183);
|
||||
customMap.Circle = new CustomCircle {
|
||||
Position = position,
|
||||
Radius = 1000
|
||||
};
|
||||
|
||||
customMap.Pins.Add (pin);
|
||||
customMap.MoveToRegion (MapSpan.FromCenterAndRadius (position, Distance.FromMiles (1.0)));
|
||||
|
||||
Content = customMap;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
---
|
||||
name: Xamarin.Forms - Circle Map Overlay
|
||||
description: "How to add a circular overlay to a map in order to highlight a circular area..."
|
||||
page_type: sample
|
||||
languages:
|
||||
- csharp
|
||||
products:
|
||||
- xamarin
|
||||
extensions:
|
||||
tags:
|
||||
- map
|
||||
- customrenderer
|
||||
urlFragment: customrenderers-map-circle
|
||||
---
|
||||
# Circle Map Overlay
|
||||
|
||||
This sample demonstrates how to add a circular overlay to a map in order to highlight a circular area of the map.
|
||||
|
||||
For more information about this sample see [Highlighting a Circular Area on a Map](https://docs.microsoft.com/xamarin/xamarin-forms/app-fundamentals/custom-renderer/map/circle-map-overlay).
|
||||
|
||||
![Circle Map Overlay application screenshot](Screenshots/01All.png "Circle Map Overlay application screenshot")
|
||||
|
После Ширина: | Высота: | Размер: 149 KiB |
|
@ -0,0 +1,8 @@
|
|||
<Application
|
||||
x:Class="MapOverlay.UWP.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:MapOverlay.UWP"
|
||||
RequestedTheme="Light">
|
||||
|
||||
</Application>
|
|
@ -0,0 +1,97 @@
|
|||
using System;
|
||||
using Windows.ApplicationModel;
|
||||
using Windows.ApplicationModel.Activation;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Navigation;
|
||||
|
||||
namespace MapOverlay.UWP
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides application-specific behavior to supplement the default Application class.
|
||||
/// </summary>
|
||||
sealed partial class App : Application
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes the singleton application object. This is the first line of authored code
|
||||
/// executed, and as such is the logical equivalent of main() or WinMain().
|
||||
/// </summary>
|
||||
public App()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
this.Suspending += OnSuspending;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when the application is launched normally by the end user. Other entry points
|
||||
/// will be used such as when the application is launched to open a specific file.
|
||||
/// </summary>
|
||||
/// <param name="e">Details about the launch request and process.</param>
|
||||
protected override void OnLaunched(LaunchActivatedEventArgs e)
|
||||
{
|
||||
|
||||
#if DEBUG
|
||||
if (System.Diagnostics.Debugger.IsAttached)
|
||||
{
|
||||
this.DebugSettings.EnableFrameRateCounter = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
Frame rootFrame = Window.Current.Content as Frame;
|
||||
|
||||
// Do not repeat app initialization when the Window already has content,
|
||||
// just ensure that the window is active
|
||||
if (rootFrame == null)
|
||||
{
|
||||
// Create a Frame to act as the navigation context and navigate to the first page
|
||||
rootFrame = new Frame();
|
||||
|
||||
rootFrame.NavigationFailed += OnNavigationFailed;
|
||||
|
||||
Xamarin.Forms.Forms.Init(e);
|
||||
|
||||
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
|
||||
{
|
||||
//TODO: Load state from previously suspended application
|
||||
}
|
||||
|
||||
// Place the frame in the current Window
|
||||
Window.Current.Content = rootFrame;
|
||||
}
|
||||
|
||||
if (rootFrame.Content == null)
|
||||
{
|
||||
// When the navigation stack isn't restored navigate to the first page,
|
||||
// configuring the new page by passing required information as a navigation
|
||||
// parameter
|
||||
rootFrame.Navigate(typeof(MainPage), e.Arguments);
|
||||
}
|
||||
// Ensure the current window is active
|
||||
Window.Current.Activate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when Navigation to a certain page fails
|
||||
/// </summary>
|
||||
/// <param name="sender">The Frame which failed navigation</param>
|
||||
/// <param name="e">Details about the navigation failure</param>
|
||||
void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
|
||||
{
|
||||
throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when application execution is being suspended. Application state is saved
|
||||
/// without knowing whether the application will be terminated or resumed with the contents
|
||||
/// of memory still intact.
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the suspend request.</param>
|
||||
/// <param name="e">Details about the suspend request.</param>
|
||||
private void OnSuspending(object sender, SuspendingEventArgs e)
|
||||
{
|
||||
var deferral = e.SuspendingOperation.GetDeferral();
|
||||
//TODO: Save application state and stop any background activity
|
||||
deferral.Complete();
|
||||
}
|
||||
}
|
||||
}
|
После Ширина: | Высота: | Размер: 1.4 KiB |
После Ширина: | Высота: | Размер: 7.5 KiB |
После Ширина: | Высота: | Размер: 2.9 KiB |
После Ширина: | Высота: | Размер: 1.6 KiB |
Двоичные данные
Docs/Map Circle/Sample/UWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
Executable file
После Ширина: | Высота: | Размер: 1.2 KiB |
После Ширина: | Высота: | Размер: 1.4 KiB |
После Ширина: | Высота: | Размер: 3.1 KiB |
|
@ -0,0 +1,68 @@
|
|||
using MapOverlay;
|
||||
using MapOverlay.UWP;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Windows.Devices.Geolocation;
|
||||
using Windows.UI.Xaml.Controls.Maps;
|
||||
using Xamarin.Forms.Maps;
|
||||
using Xamarin.Forms.Maps.UWP;
|
||||
using Xamarin.Forms.Platform.UWP;
|
||||
|
||||
[assembly: ExportRenderer(typeof(CustomMap), typeof(CustomMapRenderer))]
|
||||
namespace MapOverlay.UWP
|
||||
{
|
||||
public class CustomMapRenderer : MapRenderer
|
||||
{
|
||||
const int EarthRadiusInMeteres = 6371000;
|
||||
|
||||
protected override void OnElementChanged(ElementChangedEventArgs<Map> e)
|
||||
{
|
||||
base.OnElementChanged(e);
|
||||
|
||||
if (e.OldElement != null)
|
||||
{
|
||||
// Unsubscribe
|
||||
}
|
||||
if (e.NewElement != null)
|
||||
{
|
||||
var formsMap = (CustomMap)e.NewElement;
|
||||
var nativeMap = Control as MapControl;
|
||||
var circle = formsMap.Circle;
|
||||
|
||||
var coordinates = new List<BasicGeoposition>();
|
||||
var positions = GenerateCircleCoordinates(circle.Position, circle.Radius);
|
||||
foreach (var position in positions)
|
||||
{
|
||||
coordinates.Add(new BasicGeoposition { Latitude = position.Latitude, Longitude = position.Longitude });
|
||||
}
|
||||
|
||||
var polygon = new MapPolygon();
|
||||
polygon.FillColor = Windows.UI.Color.FromArgb(128, 255, 0, 0);
|
||||
polygon.StrokeColor = Windows.UI.Color.FromArgb(128, 255, 0, 0);
|
||||
polygon.StrokeThickness = 5;
|
||||
polygon.Path = new Geopath(coordinates);
|
||||
nativeMap.MapElements.Add(polygon);
|
||||
}
|
||||
}
|
||||
|
||||
List<Position> GenerateCircleCoordinates(Position position, double radius)
|
||||
{
|
||||
double latitude = position.Latitude.ToRadians();
|
||||
double longitude = position.Longitude.ToRadians();
|
||||
double distance = radius / EarthRadiusInMeteres;
|
||||
var positions = new List<Position>();
|
||||
|
||||
for (int angle = 0; angle <=360; angle++)
|
||||
{
|
||||
double angleInRadians = ((double)angle).ToRadians();
|
||||
double latitudeInRadians = Math.Asin(Math.Sin(latitude) * Math.Cos(distance) + Math.Cos(latitude) * Math.Sin(distance) * Math.Cos(angleInRadians));
|
||||
double longitudeInRadians = longitude + Math.Atan2(Math.Sin(angleInRadians) * Math.Sin(distance) * Math.Cos(latitude), Math.Cos(distance) - Math.Sin(latitude) * Math.Sin(latitudeInRadians));
|
||||
|
||||
var pos = new Position(latitudeInRadians.ToDegrees(), longitudeInRadians.ToDegrees());
|
||||
positions.Add(pos);
|
||||
}
|
||||
|
||||
return positions;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
using System;
|
||||
|
||||
namespace MapOverlay.UWP
|
||||
{
|
||||
public static class DoubleExtensions
|
||||
{
|
||||
public static double ToRadians(this double degrees)
|
||||
{
|
||||
return degrees * (Math.PI / 180);
|
||||
}
|
||||
|
||||
static public double ToDegrees(this double radians)
|
||||
{
|
||||
return radians * (180 / Math.PI);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
<forms:WindowsPage
|
||||
x:Class="MapOverlay.UWP.MainPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:MapOverlay.UWP"
|
||||
xmlns:forms="using:Xamarin.Forms.Platform.UWP"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
|
||||
</Grid>
|
||||
</forms:WindowsPage>
|
|
@ -0,0 +1,15 @@
|
|||
namespace MapOverlay.UWP
|
||||
{
|
||||
/// <summary>
|
||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
||||
/// </summary>
|
||||
public sealed partial class MainPage
|
||||
{
|
||||
public MainPage()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
Xamarin.FormsMaps.Init("INSERT_MAP_KEY_HERE");
|
||||
this.LoadApplication(new MapOverlay.App());
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,142 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<ProjectGuid>{17A70047-76FD-485F-91E4-9D68A8490277}</ProjectGuid>
|
||||
<OutputType>AppContainerExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>MapOverlay.UWP</RootNamespace>
|
||||
<AssemblyName>MapOverlay.UWP</AssemblyName>
|
||||
<DefaultLanguage>en-US</DefaultLanguage>
|
||||
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
|
||||
<TargetPlatformVersion>10.0.16299.0</TargetPlatformVersion>
|
||||
<TargetPlatformMinVersion>10.0.16299.0</TargetPlatformMinVersion>
|
||||
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<PackageCertificateKeyFile>MapOverlay.UWP_TemporaryKey.pfx</PackageCertificateKeyFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x86\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<OutputPath>bin\x86\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\ARM\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>ARM</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
|
||||
<OutputPath>bin\ARM\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>ARM</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<OutputPath>bin\x64\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.0.12" />
|
||||
<PackageReference Include="Xamarin.Forms" Version="4.5.0.356" />
|
||||
<PackageReference Include="Xamarin.Forms.Maps" Version="4.5.0.356" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup>
|
||||
<Compile Include="App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="CustomMapRenderer.cs" />
|
||||
<Compile Include="DoubleExtensions.cs" />
|
||||
<Compile Include="MainPage.xaml.cs">
|
||||
<DependentUpon>MainPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AppxManifest Include="Package.appxmanifest">
|
||||
<SubType>Designer</SubType>
|
||||
</AppxManifest>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Properties\Default.rd.xml" />
|
||||
<Content Include="Assets\LockScreenLogo.scale-200.png" />
|
||||
<Content Include="Assets\SplashScreen.scale-200.png" />
|
||||
<Content Include="Assets\Square150x150Logo.scale-200.png" />
|
||||
<Content Include="Assets\Square44x44Logo.scale-200.png" />
|
||||
<Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
|
||||
<Content Include="Assets\StoreLogo.png" />
|
||||
<Content Include="Assets\Wide310x150Logo.scale-200.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="App.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Page Include="MainPage.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\MapOverlay\MapOverlay.csproj">
|
||||
<Project>{61E6D969-58D3-47D8-B653-410B26EE1FE6}</Project>
|
||||
<Name>MapOverlay</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '14.0' ">
|
||||
<VisualStudioVersion>14.0</VisualStudioVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
|
||||
</Project>
|
|
@ -0,0 +1,49 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<Package
|
||||
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
|
||||
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
|
||||
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
|
||||
IgnorableNamespaces="uap mp">
|
||||
|
||||
<Identity
|
||||
Name="75aec2d3-5637-4851-bfc7-a1fd4be2f8d9"
|
||||
Publisher="CN=Dave"
|
||||
Version="1.0.0.0" />
|
||||
|
||||
<mp:PhoneIdentity PhoneProductId="75aec2d3-5637-4851-bfc7-a1fd4be2f8d9" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
|
||||
|
||||
<Properties>
|
||||
<DisplayName>MapOverlay.UWP</DisplayName>
|
||||
<PublisherDisplayName>Dave</PublisherDisplayName>
|
||||
<Logo>Assets\StoreLogo.png</Logo>
|
||||
</Properties>
|
||||
|
||||
<Dependencies>
|
||||
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
|
||||
</Dependencies>
|
||||
|
||||
<Resources>
|
||||
<Resource Language="x-generate"/>
|
||||
</Resources>
|
||||
|
||||
<Applications>
|
||||
<Application Id="App"
|
||||
Executable="$targetnametoken$.exe"
|
||||
EntryPoint="MapOverlay.UWP.App">
|
||||
<uap:VisualElements
|
||||
DisplayName="MapOverlay.UWP"
|
||||
Square150x150Logo="Assets\Square150x150Logo.png"
|
||||
Square44x44Logo="Assets\Square44x44Logo.png"
|
||||
Description="MapOverlay.UWP"
|
||||
BackgroundColor="transparent">
|
||||
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png"/>
|
||||
<uap:SplashScreen Image="Assets\SplashScreen.png" />
|
||||
</uap:VisualElements>
|
||||
</Application>
|
||||
</Applications>
|
||||
|
||||
<Capabilities>
|
||||
<Capability Name="internetClient" />
|
||||
</Capabilities>
|
||||
</Package>
|
|
@ -0,0 +1,29 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("MapOverlay.UWP")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("MapOverlay.UWP")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2016")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
[assembly: ComVisible(false)]
|
|
@ -0,0 +1,31 @@
|
|||
<!--
|
||||
This file contains Runtime Directives used by .NET Native. The defaults here are suitable for most
|
||||
developers. However, you can modify these parameters to modify the behavior of the .NET Native
|
||||
optimizer.
|
||||
|
||||
Runtime Directives are documented at http://go.microsoft.com/fwlink/?LinkID=391919
|
||||
|
||||
To fully enable reflection for App1.MyClass and all of its public/private members
|
||||
<Type Name="App1.MyClass" Dynamic="Required All"/>
|
||||
|
||||
To enable dynamic creation of the specific instantiation of AppClass<T> over System.Int32
|
||||
<TypeInstantiation Name="App1.AppClass" Arguments="System.Int32" Activate="Required Public" />
|
||||
|
||||
Using the Namespace directive to apply reflection policy to all the types in a particular namespace
|
||||
<Namespace Name="DataClasses.ViewModels" Seralize="All" />
|
||||
-->
|
||||
|
||||
<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
|
||||
<Application>
|
||||
<!--
|
||||
An Assembly element with Name="*Application*" applies to all assemblies in
|
||||
the application package. The asterisks are not wildcards.
|
||||
-->
|
||||
<Assembly Name="*Application*" Dynamic="Required All" />
|
||||
|
||||
|
||||
<!-- Add your application specific runtime directives here. -->
|
||||
|
||||
|
||||
</Application>
|
||||
</Directives>
|
|
@ -0,0 +1,27 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using Foundation;
|
||||
using UIKit;
|
||||
|
||||
namespace MapOverlay.iOS
|
||||
{
|
||||
[Register ("AppDelegate")]
|
||||
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
|
||||
{
|
||||
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
|
||||
{
|
||||
global::Xamarin.Forms.Forms.Init ();
|
||||
Xamarin.FormsMaps.Init ();
|
||||
|
||||
App.ScreenWidth = UIScreen.MainScreen.Bounds.Width;
|
||||
App.ScreenHeight = UIScreen.MainScreen.Bounds.Height;
|
||||
|
||||
LoadApplication (new App ());
|
||||
|
||||
return base.FinishedLaunching (app, options);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
using MapKit;
|
||||
using MapOverlay;
|
||||
using MapOverlay.iOS;
|
||||
using ObjCRuntime;
|
||||
using UIKit;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Maps.iOS;
|
||||
using Xamarin.Forms.Platform.iOS;
|
||||
|
||||
[assembly: ExportRenderer(typeof(CustomMap), typeof(CustomMapRenderer))]
|
||||
namespace MapOverlay.iOS
|
||||
{
|
||||
public class CustomMapRenderer : MapRenderer
|
||||
{
|
||||
MKCircleRenderer circleRenderer;
|
||||
|
||||
protected override void OnElementChanged(ElementChangedEventArgs<View> e)
|
||||
{
|
||||
base.OnElementChanged(e);
|
||||
|
||||
if (e.OldElement != null)
|
||||
{
|
||||
var nativeMap = Control as MKMapView;
|
||||
if (nativeMap != null)
|
||||
{
|
||||
nativeMap.RemoveOverlays(nativeMap.Overlays);
|
||||
nativeMap.OverlayRenderer = null;
|
||||
circleRenderer = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (e.NewElement != null)
|
||||
{
|
||||
var formsMap = (CustomMap)e.NewElement;
|
||||
var nativeMap = Control as MKMapView;
|
||||
var circle = formsMap.Circle;
|
||||
|
||||
nativeMap.OverlayRenderer = GetOverlayRenderer;
|
||||
|
||||
var circleOverlay = MKCircle.Circle(new CoreLocation.CLLocationCoordinate2D(circle.Position.Latitude, circle.Position.Longitude), circle.Radius);
|
||||
nativeMap.AddOverlay(circleOverlay);
|
||||
}
|
||||
}
|
||||
|
||||
MKOverlayRenderer GetOverlayRenderer(MKMapView mapView, IMKOverlay overlayWrapper)
|
||||
{
|
||||
if (circleRenderer == null && !Equals(overlayWrapper, null))
|
||||
{
|
||||
var overlay = Runtime.GetNSObject(overlayWrapper.Handle) as IMKOverlay;
|
||||
circleRenderer = new MKCircleRenderer(overlay as MKCircle)
|
||||
{
|
||||
FillColor = UIColor.Red,
|
||||
Alpha = 0.4f
|
||||
};
|
||||
}
|
||||
return circleRenderer;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
</dict>
|
||||
</plist>
|
||||
|
После Ширина: | Высота: | Размер: 33 KiB |
После Ширина: | Высота: | Размер: 20 KiB |
|
@ -0,0 +1,64 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>MapOverlay</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.companyname.mapoverlay</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true />
|
||||
<key>MinimumOSVersion</key>
|
||||
<string>9.0</string>
|
||||
<key>UIDeviceFamily</key>
|
||||
<array>
|
||||
<integer>1</integer>
|
||||
<integer>2</integer>
|
||||
</array>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>CFBundleIconFiles</key>
|
||||
<array>
|
||||
<string>Icon-60@2x</string>
|
||||
<string>Icon-60@3x</string>
|
||||
<string>Icon-76</string>
|
||||
<string>Icon-76@2x</string>
|
||||
<string>Default</string>
|
||||
<string>Default@2x</string>
|
||||
<string>Default-568h</string>
|
||||
<string>Default-568h@2x</string>
|
||||
<string>Default-Landscape</string>
|
||||
<string>Default-Landscape@2x</string>
|
||||
<string>Default-Portrait</string>
|
||||
<string>Default-Portrait@2x</string>
|
||||
<string>Icon-Small-40</string>
|
||||
<string>Icon-Small-40@2x</string>
|
||||
<string>Icon-Small-40@3x</string>
|
||||
<string>Icon-Small</string>
|
||||
<string>Icon-Small@2x</string>
|
||||
<string>Icon-Small@3x</string>
|
||||
</array>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using Foundation;
|
||||
using UIKit;
|
||||
|
||||
namespace MapOverlay.iOS
|
||||
{
|
||||
public class Application
|
||||
{
|
||||
// This is the main entry point of the application.
|
||||
static void Main (string[] args)
|
||||
{
|
||||
// if you want to use a different Application Delegate class from "AppDelegate"
|
||||
// you can specify it here.
|
||||
UIApplication.Main (args, null, "AppDelegate");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,121 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
|
||||
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<ProjectGuid>{6A579B08-685B-4DDD-81EA-D15B22CFE5B6}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>MapOverlay.iOS</RootNamespace>
|
||||
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
|
||||
<AssemblyName>MapOverlayiOS</AssemblyName>
|
||||
<NuGetPackageImportStamp />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;ENABLE_TEST_CLOUD;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<MtouchArch>x86_64</MtouchArch>
|
||||
<MtouchLink>None</MtouchLink>
|
||||
<MtouchDebug>true</MtouchDebug>
|
||||
<MtouchProfiling>true</MtouchProfiling>
|
||||
<MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\iPhone\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
|
||||
<MtouchArch>ARM64</MtouchArch>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
<MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\iPhoneSimulator\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<MtouchArch>x86_64</MtouchArch>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<MtouchLink>None</MtouchLink>
|
||||
<MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\iPhone\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;ENABLE_TEST_CLOUD;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<MtouchArch>ARM64</MtouchArch>
|
||||
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
|
||||
<MtouchProfiling>true</MtouchProfiling>
|
||||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
<MtouchDebug>true</MtouchDebug>
|
||||
<MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Xamarin.Forms" Version="4.5.0.356" />
|
||||
<PackageReference Include="Xamarin.Forms.Maps" Version="4.5.0.356" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="Xamarin.iOS" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\MapOverlay\MapOverlay.csproj">
|
||||
<Project>{61E6D969-58D3-47D8-B653-410B26EE1FE6}</Project>
|
||||
<Name>MapOverlay</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\Default.png" />
|
||||
<BundleResource Include="Resources\Default%402x.png" />
|
||||
<BundleResource Include="Resources\Default-568h%402x.png" />
|
||||
<BundleResource Include="Resources\Default-Portrait.png" />
|
||||
<BundleResource Include="Resources\Default-Portrait%402x.png" />
|
||||
<BundleResource Include="Resources\Icon-60%402x.png" />
|
||||
<BundleResource Include="Resources\Icon-60%403x.png" />
|
||||
<BundleResource Include="Resources\Icon-76.png" />
|
||||
<BundleResource Include="Resources\Icon-76%402x.png" />
|
||||
<BundleResource Include="Resources\Icon-Small.png" />
|
||||
<BundleResource Include="Resources\Icon-Small%402x.png" />
|
||||
<BundleResource Include="Resources\Icon-Small%403x.png" />
|
||||
<BundleResource Include="Resources\Icon-Small-40.png" />
|
||||
<BundleResource Include="Resources\Icon-Small-40%402x.png" />
|
||||
<BundleResource Include="Resources\Icon-Small-40%403x.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<InterfaceDefinition Include="Resources\LaunchScreen.storyboard" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Info.plist" />
|
||||
<None Include="Entitlements.plist" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Main.cs" />
|
||||
<Compile Include="AppDelegate.cs" />
|
||||
<Compile Include="CustomMapRenderer.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ITunesArtwork Include="ITunesArtwork" />
|
||||
<ITunesArtwork Include="ITunesArtwork%402x" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup />
|
||||
</Target>
|
||||
</Project>
|
После Ширина: | Высота: | Размер: 8.7 KiB |
После Ширина: | Высота: | Размер: 10 KiB |
После Ширина: | Высота: | Размер: 34 KiB |
После Ширина: | Высота: | Размер: 7.1 KiB |
После Ширина: | Высота: | Размер: 8.2 KiB |
После Ширина: | Высота: | Размер: 1.7 KiB |
После Ширина: | Высота: | Размер: 21 KiB |
После Ширина: | Высота: | Размер: 1.2 KiB |
После Ширина: | Высота: | Размер: 2.2 KiB |
После Ширина: | Высота: | Размер: 729 B |
После Ширина: | Высота: | Размер: 1.2 KiB |
После Ширина: | Высота: | Размер: 12 KiB |
После Ширина: | Высота: | Размер: 1.1 KiB |
После Ширина: | Высота: | Размер: 955 B |
После Ширина: | Высота: | Размер: 7.1 KiB |
|
@ -0,0 +1,39 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6245" systemVersion="13F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="X5k-f2-b5h">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6238"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="gAE-YM-kbH">
|
||||
<objects>
|
||||
<viewController id="X5k-f2-b5h" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="Y8P-hJ-Z43"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="9ZL-r4-8FZ"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="yd7-JS-zBw">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" misplaced="YES" image="Icon-60.png" translatesAutoresizingMaskIntoConstraints="NO" id="23">
|
||||
<rect key="frame" x="270" y="270" width="60" height="60"/>
|
||||
<rect key="contentStretch" x="0.0" y="0.0" width="0.0" height="0.0"/>
|
||||
</imageView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="0.20392156862745098" green="0.59607843137254901" blue="0.85882352941176465" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<constraints>
|
||||
<constraint firstItem="23" firstAttribute="centerY" secondItem="yd7-JS-zBw" secondAttribute="centerY" priority="1" id="39"/>
|
||||
<constraint firstItem="23" firstAttribute="centerX" secondItem="yd7-JS-zBw" secondAttribute="centerX" priority="1" id="41"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="XAI-xm-WK6" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="349" y="339"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
<resources>
|
||||
<image name="Icon-60.png" width="180" height="180"/>
|
||||
</resources>
|
||||
</document>
|
После Ширина: | Высота: | Размер: 149 KiB |
|
@ -0,0 +1,332 @@
|
|||
---
|
||||
title: "Highlighting a Circular Area on a Map"
|
||||
description: "This article explains how to add a circular overlay to a map, to highlight a circular area of the map. While iOS and Android provide APIs for adding the circular overlay to the map, on UWP the overlay is rendered as a polygon."
|
||||
ms.prod: xamarin
|
||||
ms.assetid: 6FF8BD15-074E-4E6A-9522-F9E2BE32EF12
|
||||
ms.technology: xamarin-forms
|
||||
author: davidbritch
|
||||
ms.author: dabritch
|
||||
ms.date: 11/29/2017
|
||||
---
|
||||
|
||||
# Highlighting a Circular Area on a Map
|
||||
|
||||
[![Download Sample](~/media/shared/download.png) Download the sample](https://docs.microsoft.com/samples/xamarin/xamarin-forms-samples/customrenderers-map-circle)
|
||||
|
||||
_This article explains how to add a circular overlay to a map, to highlight a circular area of the map._
|
||||
|
||||
## Overview
|
||||
|
||||
An overlay is a layered graphic on a map. Overlays support drawing graphical content that scales with the map as it is zoomed. The following screenshots show the result of adding a circular overlay to a map:
|
||||
|
||||
![](circle-map-overlay-images/screenshots.png)
|
||||
|
||||
When a [`Map`](xref:Xamarin.Forms.Maps.Map) control is rendered by a Xamarin.Forms application, in iOS the `MapRenderer` class is instantiated, which in turn instantiates a native `MKMapView` control. On the Android platform, the `MapRenderer` class instantiates a native `MapView` control. On the Universal Windows Platform (UWP), the `MapRenderer` class instantiates a native `MapControl`. The rendering process can be taken advantage of to implement platform-specific map customizations by creating a custom renderer for a `Map` on each platform. The process for doing this is as follows:
|
||||
|
||||
1. [Create](#Creating_the_Custom_Map) a Xamarin.Forms custom map.
|
||||
1. [Consume](#Consuming_the_Custom_Map) the custom map from Xamarin.Forms.
|
||||
1. [Customize](#Customizing_the_Map) the map by creating a custom renderer for the map on each platform.
|
||||
|
||||
> [!NOTE]
|
||||
> [`Xamarin.Forms.Maps`](xref:Xamarin.Forms.Maps) must be initialized and configured before use. For more information, see [`Maps Control`](~/xamarin-forms/user-interface/map/index.md)
|
||||
|
||||
For information about customizing a map using a custom renderer, see [Customizing a Map Pin](~/xamarin-forms/app-fundamentals/custom-renderer/map/customized-pin.md).
|
||||
|
||||
<a name="Creating_the_Custom_Map" />
|
||||
|
||||
### Creating the Custom Map
|
||||
|
||||
Create a `CustomCircle` class that has `Position` and `Radius` properties:
|
||||
|
||||
```csharp
|
||||
public class CustomCircle
|
||||
{
|
||||
public Position Position { get; set; }
|
||||
public double Radius { get; set; }
|
||||
}
|
||||
```
|
||||
|
||||
Then, create a subclass of the [`Map`](xref:Xamarin.Forms.Maps.Map) class, that adds a property of type `CustomCircle`:
|
||||
|
||||
```csharp
|
||||
public class CustomMap : Map
|
||||
{
|
||||
public CustomCircle Circle { get; set; }
|
||||
}
|
||||
```
|
||||
|
||||
<a name="Consuming_the_Custom_Map" />
|
||||
|
||||
### Consuming the Custom Map
|
||||
|
||||
Consume the `CustomMap` control by declaring an instance of it in the XAML page instance:
|
||||
|
||||
```xaml
|
||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:local="clr-namespace:MapOverlay;assembly=MapOverlay"
|
||||
x:Class="MapOverlay.MapPage">
|
||||
<ContentPage.Content>
|
||||
<local:CustomMap x:Name="customMap" MapType="Street" WidthRequest="{x:Static local:App.ScreenWidth}" HeightRequest="{x:Static local:App.ScreenHeight}" />
|
||||
</ContentPage.Content>
|
||||
</ContentPage>
|
||||
```
|
||||
|
||||
Alternatively, consume the `CustomMap` control by declaring an instance of it in the C# page instance:
|
||||
|
||||
```csharp
|
||||
public class MapPageCS : ContentPage
|
||||
{
|
||||
public MapPageCS ()
|
||||
{
|
||||
var customMap = new CustomMap {
|
||||
MapType = MapType.Street,
|
||||
WidthRequest = App.ScreenWidth,
|
||||
HeightRequest = App.ScreenHeight
|
||||
};
|
||||
...
|
||||
Content = customMap;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Initialize the `CustomMap` control as required:
|
||||
|
||||
```csharp
|
||||
public partial class MapPage : ContentPage
|
||||
{
|
||||
public MapPage ()
|
||||
{
|
||||
...
|
||||
var pin = new Pin {
|
||||
Type = PinType.Place,
|
||||
Position = new Position (37.79752, -122.40183),
|
||||
Label = "Xamarin San Francisco Office",
|
||||
Address = "394 Pacific Ave, San Francisco CA"
|
||||
};
|
||||
|
||||
var position = new Position (37.79752, -122.40183);
|
||||
customMap.Circle = new CustomCircle {
|
||||
Position = position,
|
||||
Radius = 1000
|
||||
};
|
||||
|
||||
customMap.Pins.Add (pin);
|
||||
customMap.MoveToRegion (MapSpan.FromCenterAndRadius (position, Distance.FromMiles (1.0)));
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
This initialization adds [`Pin`](xref:Xamarin.Forms.Maps.Pin) and `CustomCircle` instances to the custom map, and positions the map's view with the [`MoveToRegion`](xref:Xamarin.Forms.Maps.Map.MoveToRegion*) method, which changes the position and zoom level of the map by creating a [`MapSpan`](xref:Xamarin.Forms.Maps.MapSpan) from a [`Position`](xref:Xamarin.Forms.Maps.Position) and a [`Distance`](xref:Xamarin.Forms.Maps.Distance).
|
||||
|
||||
<a name="Customizing_the_Map" />
|
||||
|
||||
### Customizing the Map
|
||||
|
||||
A custom renderer must now be added to each application project to add the circular overlay to the map.
|
||||
|
||||
#### Creating the Custom Renderer on iOS
|
||||
|
||||
Create a subclass of the `MapRenderer` class and override its `OnElementChanged` method to add the circular overlay:
|
||||
|
||||
```csharp
|
||||
[assembly: ExportRenderer(typeof(CustomMap), typeof(CustomMapRenderer))]
|
||||
namespace MapOverlay.iOS
|
||||
{
|
||||
public class CustomMapRenderer : MapRenderer
|
||||
{
|
||||
MKCircleRenderer circleRenderer;
|
||||
|
||||
protected override void OnElementChanged(ElementChangedEventArgs<View> e)
|
||||
{
|
||||
base.OnElementChanged(e);
|
||||
|
||||
if (e.OldElement != null) {
|
||||
var nativeMap = Control as MKMapView;
|
||||
if (nativeMap != null) {
|
||||
nativeMap.RemoveOverlays(nativeMap.Overlays);
|
||||
nativeMap.OverlayRenderer = null;
|
||||
circleRenderer = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (e.NewElement != null) {
|
||||
var formsMap = (CustomMap)e.NewElement;
|
||||
var nativeMap = Control as MKMapView;
|
||||
var circle = formsMap.Circle;
|
||||
|
||||
nativeMap.OverlayRenderer = GetOverlayRenderer;
|
||||
|
||||
var circleOverlay = MKCircle.Circle(new CoreLocation.CLLocationCoordinate2D(circle.Position.Latitude, circle.Position.Longitude), circle.Radius);
|
||||
nativeMap.AddOverlay(circleOverlay);
|
||||
}
|
||||
}
|
||||
...
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
This method performs the following configuration, provided that the custom renderer is attached to a new Xamarin.Forms element:
|
||||
|
||||
- The `MKMapView.OverlayRenderer` property is set to a corresponding delegate.
|
||||
- The circle is created by setting a static `MKCircle` object that specifies the center of the circle, and the radius of the circle in meters.
|
||||
- The circle is added to the map by calling the `MKMapView.AddOverlay` method.
|
||||
|
||||
Then, implement the `GetOverlayRenderer` method to customize the rendering of the overlay:
|
||||
|
||||
```csharp
|
||||
public class CustomMapRenderer : MapRenderer
|
||||
{
|
||||
MKCircleRenderer circleRenderer;
|
||||
...
|
||||
|
||||
MKOverlayRenderer GetOverlayRenderer(MKMapView mapView, IMKOverlay overlayWrapper)
|
||||
{
|
||||
if (circleRenderer == null && !Equals(overlayWrapper, null)) {
|
||||
var overlay = Runtime.GetNSObject(overlayWrapper.Handle) as IMKOverlay;
|
||||
circleRenderer = new MKCircleRenderer(overlay as MKCircle) {
|
||||
FillColor = UIColor.Red,
|
||||
Alpha = 0.4f
|
||||
};
|
||||
}
|
||||
return circleRenderer;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Creating the Custom Renderer on Android
|
||||
|
||||
Create a subclass of the `MapRenderer` class and override its `OnElementChanged` and `OnMapReady` methods to add the circular overlay:
|
||||
|
||||
```csharp
|
||||
[assembly: ExportRenderer(typeof(CustomMap), typeof(CustomMapRenderer))]
|
||||
namespace MapOverlay.Droid
|
||||
{
|
||||
public class CustomMapRenderer : MapRenderer
|
||||
{
|
||||
CustomCircle circle;
|
||||
|
||||
public CustomMapRenderer(Context context) : base(context)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnElementChanged(Xamarin.Forms.Platform.Android.ElementChangedEventArgs<Xamarin.Forms.Maps.Map> e)
|
||||
{
|
||||
base.OnElementChanged(e);
|
||||
|
||||
if (e.OldElement != null)
|
||||
{
|
||||
// Unsubscribe
|
||||
}
|
||||
|
||||
if (e.NewElement != null)
|
||||
{
|
||||
var formsMap = (CustomMap)e.NewElement;
|
||||
circle = formsMap.Circle;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnMapReady(Android.Gms.Maps.GoogleMap map)
|
||||
{
|
||||
base.OnMapReady(map);
|
||||
|
||||
var circleOptions = new CircleOptions();
|
||||
circleOptions.InvokeCenter(new LatLng(circle.Position.Latitude, circle.Position.Longitude));
|
||||
circleOptions.InvokeRadius(circle.Radius);
|
||||
circleOptions.InvokeFillColor(0X66FF0000);
|
||||
circleOptions.InvokeStrokeColor(0X66FF0000);
|
||||
circleOptions.InvokeStrokeWidth(0);
|
||||
|
||||
NativeMap.AddCircle(circleOptions);
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The `OnElementChanged` method retrieves the custom circle data, provided that the custom renderer is attached to a new Xamarin.Forms element. Once the `GoogleMap` instance is available, the `OnMapReady` method will be invoked, where the circle is created by instantiating a `CircleOptions` object that specifies the center of the circle, and the radius of the circle in meters. The circle is then added to the map by calling the `NativeMap.AddCircle` method.
|
||||
|
||||
#### Creating the Custom Renderer on the Universal Windows Platform
|
||||
|
||||
Create a subclass of the `MapRenderer` class and override its `OnElementChanged` method to add the circular overlay:
|
||||
|
||||
```csharp
|
||||
[assembly: ExportRenderer(typeof(CustomMap), typeof(CustomMapRenderer))]
|
||||
namespace MapOverlay.UWP
|
||||
{
|
||||
public class CustomMapRenderer : MapRenderer
|
||||
{
|
||||
const int EarthRadiusInMeteres = 6371000;
|
||||
|
||||
protected override void OnElementChanged(ElementChangedEventArgs<Map> e)
|
||||
{
|
||||
base.OnElementChanged(e);
|
||||
|
||||
if (e.OldElement != null)
|
||||
{
|
||||
// Unsubscribe
|
||||
}
|
||||
if (e.NewElement != null)
|
||||
{
|
||||
var formsMap = (CustomMap)e.NewElement;
|
||||
var nativeMap = Control as MapControl;
|
||||
var circle = formsMap.Circle;
|
||||
|
||||
var coordinates = new List<BasicGeoposition>();
|
||||
var positions = GenerateCircleCoordinates(circle.Position, circle.Radius);
|
||||
foreach (var position in positions)
|
||||
{
|
||||
coordinates.Add(new BasicGeoposition { Latitude = position.Latitude, Longitude = position.Longitude });
|
||||
}
|
||||
|
||||
var polygon = new MapPolygon();
|
||||
polygon.FillColor = Windows.UI.Color.FromArgb(128, 255, 0, 0);
|
||||
polygon.StrokeColor = Windows.UI.Color.FromArgb(128, 255, 0, 0);
|
||||
polygon.StrokeThickness = 5;
|
||||
polygon.Path = new Geopath(coordinates);
|
||||
nativeMap.MapElements.Add(polygon);
|
||||
}
|
||||
}
|
||||
// GenerateCircleCoordinates helper method (below)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
This method performs the following operations, provided that the custom renderer is attached to a new Xamarin.Forms element:
|
||||
|
||||
- The circle position and radius are retrieved from the `CustomMap.Circle` property and passed to the `GenerateCircleCoordinates` method, which generates latitude and longitude coordinates for the circle perimeter. The code for this helper method is shown below.
|
||||
- The circle perimeter coordinates are converted into a `List` of `BasicGeoposition` coordinates.
|
||||
- The circle is created by instantiating a `MapPolygon` object. The `MapPolygon` class is used to display a multi-point shape on the map by setting its `Path` property to a `Geopath` object that contains the shape coordinates.
|
||||
- The polygon is rendered on the map by adding it to the `MapControl.MapElements` collection.
|
||||
|
||||
```
|
||||
List<Position> GenerateCircleCoordinates(Position position, double radius)
|
||||
{
|
||||
double latitude = position.Latitude.ToRadians();
|
||||
double longitude = position.Longitude.ToRadians();
|
||||
double distance = radius / EarthRadiusInMeteres;
|
||||
var positions = new List<Position>();
|
||||
|
||||
for (int angle = 0; angle <=360; angle++)
|
||||
{
|
||||
double angleInRadians = ((double)angle).ToRadians();
|
||||
double latitudeInRadians = Math.Asin(Math.Sin(latitude) * Math.Cos(distance) + Math.Cos(latitude) * Math.Sin(distance) * Math.Cos(angleInRadians));
|
||||
double longitudeInRadians = longitude + Math.Atan2(Math.Sin(angleInRadians) * Math.Sin(distance) * Math.Cos(latitude), Math.Cos(distance) - Math.Sin(latitude) * Math.Sin(latitudeInRadians));
|
||||
|
||||
var pos = new Position(latitudeInRadians.ToDegrees(), longitudeInRadians.ToDegrees());
|
||||
positions.Add(pos);
|
||||
}
|
||||
|
||||
return positions;
|
||||
}
|
||||
```
|
||||
|
||||
## Summary
|
||||
|
||||
This article explained how to add a circular overlay to a map, to highlight a circular area of the map.
|
||||
|
||||
## Related Links
|
||||
|
||||
- [Circular Map Ovlerlay (sample)](https://docs.microsoft.com/samples/xamarin/xamarin-forms-samples/customrenderers-map-circle)
|
||||
- [Customizing a Map Pin](~/xamarin-forms/app-fundamentals/custom-renderer/map/customized-pin.md)
|
||||
- [Xamarin.Forms.Maps](xref:Xamarin.Forms.Maps)
|