Skip to content

Commit

Permalink
Add LotsOfPolylinesRepro for dotnet/maui#20502
Browse files Browse the repository at this point in the history
  • Loading branch information
mfeingol committed Feb 13, 2024
1 parent 6d78b54 commit e5e17ef
Show file tree
Hide file tree
Showing 66 changed files with 2,523 additions and 0 deletions.
27 changes: 27 additions & 0 deletions LotsOfPolylinesRepro/WorkingWithMaps.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31611.283
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkingWithMaps", "WorkingWithMaps\WorkingWithMaps.csproj", "{09D2F154-E3FE-4377-B73C-2AA8028444A5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{09D2F154-E3FE-4377-B73C-2AA8028444A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{09D2F154-E3FE-4377-B73C-2AA8028444A5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{09D2F154-E3FE-4377-B73C-2AA8028444A5}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{09D2F154-E3FE-4377-B73C-2AA8028444A5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{09D2F154-E3FE-4377-B73C-2AA8028444A5}.Release|Any CPU.Build.0 = Release|Any CPU
{09D2F154-E3FE-4377-B73C-2AA8028444A5}.Release|Any CPU.Deploy.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {61F7FB11-1E47-470C-91E2-47F8143E1572}
EndGlobalSection
EndGlobal
26 changes: 26 additions & 0 deletions LotsOfPolylinesRepro/WorkingWithMaps/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version = "1.0" encoding = "UTF-8" ?>
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:WorkingWithMaps"
x:Class="WorkingWithMaps.App">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Resources/Styles/Colors.xaml" />
<ResourceDictionary Source="Resources/Styles/Styles.xaml" />
</ResourceDictionary.MergedDictionaries>

<Style TargetType="StackLayout">
<Setter Property="Spacing"
Value="6" />
</Style>
<Style TargetType="Grid">
<Setter Property="RowSpacing"
Value="6" />
<Setter Property="ColumnSpacing"
Value="6" />
</Style>

</ResourceDictionary>
</Application.Resources>
</Application>
11 changes: 11 additions & 0 deletions LotsOfPolylinesRepro/WorkingWithMaps/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace WorkingWithMaps;

public partial class App : Application
{
public App()
{
InitializeComponent();

MainPage = new AppShell();
}
}
14 changes: 14 additions & 0 deletions LotsOfPolylinesRepro/WorkingWithMaps/AppShell.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Shell
x:Class="WorkingWithMaps.AppShell"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:views="clr-namespace:WorkingWithMaps.Views"
Shell.FlyoutBehavior="Disabled">

<ShellContent
Title="Home"
ContentTemplate="{DataTemplate views:MainPage}"
Route="MainPage" />

</Shell>
9 changes: 9 additions & 0 deletions LotsOfPolylinesRepro/WorkingWithMaps/AppShell.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace WorkingWithMaps;

public partial class AppShell : Shell
{
public AppShell()
{
InitializeComponent();
}
}
25 changes: 25 additions & 0 deletions LotsOfPolylinesRepro/WorkingWithMaps/MauiProgram.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using Microsoft.Extensions.Logging;

namespace WorkingWithMaps;

public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
})
.UseMauiMaps();

#if DEBUG
builder.Logging.AddDebug();
#endif

return builder.Build();
}
}
38 changes: 38 additions & 0 deletions LotsOfPolylinesRepro/WorkingWithMaps/Models/Position.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using System.ComponentModel;

namespace WorkingWithMaps.Models
{
public class Position : INotifyPropertyChanged
{
Location _location;

public string Address { get; }
public string Description { get; }

public Location Location
{
get => _location;
set
{
if (Location == null || !_location.Equals(value))
{
_location = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Location)));
}
}
}

public Position(string address, string description, Location location)
{
Address = address;
Description = description;
Location = location;
}

#region INotifyPropertyChanged

public event PropertyChangedEventHandler PropertyChanged;

#endregion
}
}
14 changes: 14 additions & 0 deletions LotsOfPolylinesRepro/WorkingWithMaps/Models/RandomPosition.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace WorkingWithMaps.Models
{
static class RandomPosition
{
static Random Random = new Random(Environment.TickCount);

public static Location Next(Location location, double latitudeRange, double longitudeRange)
{
return new Location(
location.Latitude + (Random.NextDouble() * 2 - 1) * latitudeRange,
location.Longitude + (Random.NextDouble() * 2 - 1) * longitudeRange);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true">
<meta-data android:name="com.google.android.geo.API_KEY" android:value="INSERT_MAP_API_KEY_HERE" />
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
</application>

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />

<!-- For targeting v8.3 or greater of the Google Play services SDK -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<!-- Required to access the user's location -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using Android.App;
using Android.Content.PM;
using Android.OS;

namespace WorkingWithMaps;

[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
public class MainActivity : MauiAppCompatActivity
{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using Android.App;
using Android.Runtime;

namespace WorkingWithMaps;

[Application]
public class MainApplication : MauiApplication
{
public MainApplication(IntPtr handle, JniHandleOwnership ownership)
: base(handle, ownership)
{
}

protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#512BD4</color>
<color name="colorPrimaryDark">#2B0B98</color>
<color name="colorAccent">#2B0B98</color>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using Foundation;

namespace WorkingWithMaps;

[Register("AppDelegate")]
public class AppDelegate : MauiUIApplicationDelegate
{
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?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>UIDeviceFamily</key>
<array>
<integer>1</integer>
<integer>2</integer>
</array>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>arm64</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>XSAppIconAssets</key>
<string>Assets.xcassets/appicon.appiconset</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Can we use your location at all times?</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Can we use your location when your app is being used?</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using ObjCRuntime;
using UIKit;

namespace WorkingWithMaps;

public class Program
{
// 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, typeof(AppDelegate));
}
}
16 changes: 16 additions & 0 deletions LotsOfPolylinesRepro/WorkingWithMaps/Platforms/Tizen/Main.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System;
using Microsoft.Maui;
using Microsoft.Maui.Hosting;

namespace WorkingWithMaps;

class Program : MauiApplication
{
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();

static void Main(string[] args)
{
var app = new Program();
app.Run(args);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="maui-application-id-placeholder" version="0.0.0" api-version="7" xmlns="http://tizen.org/ns/packages">
<profile name="common" />
<ui-application appid="maui-application-id-placeholder" exec="WorkingWithMaps.dll" multiple="false" nodisplay="false" taskmanage="true" type="dotnet" launch_mode="single">
<label>maui-application-title-placeholder</label>
<icon>maui-appicon-placeholder</icon>
<metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true" />
</ui-application>
<shortcut-list />
<privileges>
<privilege>http://tizen.org/privilege/internet</privilege>
</privileges>
<dependencies />
<provides-appdefined-privileges />
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<maui:MauiWinUIApplication
x:Class="WorkingWithMaps.WinUI.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:maui="using:Microsoft.Maui"
xmlns:local="using:WorkingWithMaps.WinUI">

</maui:MauiWinUIApplication>
24 changes: 24 additions & 0 deletions LotsOfPolylinesRepro/WorkingWithMaps/Platforms/Windows/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Microsoft.UI.Xaml;

// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.

namespace WorkingWithMaps.WinUI;

/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
public partial class App : MauiWinUIApplication
{
/// <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();
}

protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap rescap">

<Identity Name="maui-package-name-placeholder" Publisher="CN=User Name" Version="0.0.0.0" />

<Properties>
<DisplayName>$placeholder$</DisplayName>
<PublisherDisplayName>User Name</PublisherDisplayName>
<Logo>$placeholder$.png</Logo>
</Properties>

<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
</Dependencies>

<Resources>
<Resource Language="x-generate" />
</Resources>

<Applications>
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="$targetentrypoint$">
<uap:VisualElements
DisplayName="$placeholder$"
Description="$placeholder$"
Square150x150Logo="$placeholder$.png"
Square44x44Logo="$placeholder$.png"
BackgroundColor="transparent">
<uap:DefaultTile Square71x71Logo="$placeholder$.png" Wide310x150Logo="$placeholder$.png" Square310x310Logo="$placeholder$.png" />
<uap:SplashScreen Image="$placeholder$.png" />
</uap:VisualElements>
</Application>
</Applications>

<Capabilities>
<rescap:Capability Name="runFullTrust" />
</Capabilities>

</Package>
Loading

0 comments on commit e5e17ef

Please sign in to comment.