Skip to content

Commit 9a2112f

Browse files
committed
Renewing Mapsui.iOS.sln
1 parent d4b9ea4 commit 9a2112f

10 files changed

Lines changed: 999 additions & 522 deletions

File tree

Mapsui.UI.Forms/Extensions/ColorExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ public static Xamarin.Forms.Color ToForms(this Styles.Color color)
1717
/// </summary>
1818
/// <param name="color">Color in Xamarin.Forms.Color format </param>
1919
/// <returns>Color in Mapsui.Styles.Color format</returns>
20-
public static Mapsui.Styles.Color ToMapsui(this Xamarin.Forms.Color color)
20+
public static Styles.Color ToMapsui(this Xamarin.Forms.Color color)
2121
{
22-
return new Mapsui.Styles.Color((int)(color.R * 255), (int)(color.G * 255), (int)(color.B * 255), (int)(color.A * 255));
22+
return new Styles.Color((int)(color.R * 255), (int)(color.G * 255), (int)(color.B * 255), (int)(color.A * 255));
2323
}
2424
}
2525
}

Mapsui.UI.Forms/Extensions/PositionExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ public static class PositionExtensions
77
/// </summary>
88
/// <param name="point">Point in Mapsui format</param>
99
/// <returns>Position in Xamarin.Forms.Maps format</returns>
10-
public static Position ToForms(this Mapsui.Geometries.Point point)
10+
public static Position ToForms(this Geometries.Point point)
1111
{
12-
var latLon = Mapsui.Projection.SphericalMercator.ToLonLat(point.X, point.Y);
12+
var latLon = Projection.SphericalMercator.ToLonLat(point.X, point.Y);
1313

1414
return new Position(latLon.Y, latLon.X);
1515
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2+
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=eventargs/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

Mapsui.iOS.sln

Lines changed: 923 additions & 517 deletions
Large diffs are not rendered by default.

Mapsui.sln.DotSettings

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@
235235
<s:Boolean x:Key="/Default/Housekeeping/ExcludedProjects/ProjectMasksToIgnore/=Mapsui_002ESamples_002EMac/@EntryIndexedValue">False</s:Boolean>
236236
<s:Boolean x:Key="/Default/Housekeeping/ExcludedProjects/ProjectMasksToIgnore/=Mapsui_002ESamples_002EMac/@EntryIndexRemoved">True</s:Boolean>
237237
<s:Boolean x:Key="/Default/UserDictionary/Words/=Dulk/@EntryIndexedValue">True</s:Boolean>
238+
<s:Boolean x:Key="/Default/UserDictionary/Words/=EPSG/@EntryIndexedValue">True</s:Boolean>
238239
<s:Boolean x:Key="/Default/UserDictionary/Words/=Geodan/@EntryIndexedValue">True</s:Boolean>
239240
<s:Boolean x:Key="/Default/UserDictionary/Words/=Mapsui/@EntryIndexedValue">True</s:Boolean>
240241
<s:Boolean x:Key="/Default/UserDictionary/Words/=Shapefile/@EntryIndexedValue">True</s:Boolean>

Samples/Mapsui.Samples.Common/Mapsui.Samples.Common.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
<ItemGroup>
7474
<ProjectReference Include="..\..\Mapsui.Geometries\Mapsui.Geometries.csproj" />
7575
<ProjectReference Include="..\..\Mapsui\Mapsui.csproj" />
76-
<ProjectReference Include="..\..\Sample\Mapsui.Samples.CustomWidget\Mapsui.Samples.CustomWidget.csproj" />
76+
<ProjectReference Include="..\Mapsui.Samples.CustomWidget\Mapsui.Samples.CustomWidget.csproj" />
7777
</ItemGroup>
7878

7979
<PropertyGroup>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using Mapsui.Geometries;
2+
using Mapsui.Styles;
3+
using Mapsui.Widgets;
4+
5+
namespace Mapsui.Samples.CustomWidget
6+
{
7+
public class CustomWidget : IWidget
8+
{
9+
public HorizontalAlignment HorizontalAlignment { get; set; }
10+
public VerticalAlignment VerticalAlignment { get; set; }
11+
public float MarginX { get; set; } = 20;
12+
public float MarginY { get; set; } = 20;
13+
public BoundingBox Envelope { get; set; }
14+
public void HandleWidgetTouched(INavigator navigator, Point position)
15+
{
16+
navigator.CenterOn(0, 0);
17+
}
18+
19+
public Color Color { get; set; }
20+
public int Width { get; set; }
21+
public int Height { get; set; }
22+
}
23+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
using Mapsui.Geometries;
2+
using Mapsui.Rendering.Skia;
3+
using Mapsui.Rendering.Skia.SkiaWidgets;
4+
using Mapsui.Widgets;
5+
using SkiaSharp;
6+
7+
namespace Mapsui.Samples.CustomWidget
8+
{
9+
public class CustomWidgetSkiaRenderer : ISkiaWidgetRenderer
10+
{
11+
public void Draw(SKCanvas canvas, IReadOnlyViewport viewport, IWidget widget, float layerOpacity)
12+
{
13+
// Cast to custom widget to be able to access the specific CustomWidget fields
14+
var customWidget = (CustomWidget) widget;
15+
16+
// Update the envelope so the MapControl can do hit detection
17+
widget.Envelope = ToEnvelope(customWidget);
18+
19+
// Use the envelope to draw
20+
canvas.DrawRect(widget.Envelope.ToSkia(), new SKPaint { Color = customWidget.Color.ToSkia(0.5f)});
21+
}
22+
23+
private static BoundingBox ToEnvelope(CustomWidget customWidget)
24+
{
25+
// A better implementation would take into account widget alignment
26+
return new BoundingBox(customWidget.MarginX, customWidget.MarginY,
27+
customWidget.MarginX + customWidget.Width,
28+
customWidget.MarginY + customWidget.Height);
29+
}
30+
}
31+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netstandard2.0</TargetFramework>
5+
</PropertyGroup>
6+
7+
<ItemGroup>
8+
<ProjectReference Include="..\..\Mapsui.Geometries\Mapsui.Geometries.csproj" />
9+
<ProjectReference Include="..\..\Mapsui.Rendering.Skia\Mapsui.Rendering.Skia.csproj" />
10+
<ProjectReference Include="..\..\Mapsui\Mapsui.csproj" />
11+
</ItemGroup>
12+
13+
</Project>

Tests/Mapsui.Tests.Common/Mapsui.Tests.Common.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
<ProjectReference Include="..\..\Mapsui.Geometries\Mapsui.Geometries.csproj" />
3333
<ProjectReference Include="..\..\Mapsui\Mapsui.csproj" />
3434
<ProjectReference Include="..\..\Samples\Mapsui.Samples.Common\Mapsui.Samples.Common.csproj" />
35+
<ProjectReference Include="..\..\Samples\Mapsui.Samples.CustomWidget\Mapsui.Samples.CustomWidget.csproj" />
3536
</ItemGroup>
3637
<ItemGroup>
3738
<Folder Include="Properties\" />

0 commit comments

Comments
 (0)