mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-06 23:15:14 +00:00
Added MapsforgeTiles projects
This commit is contained in:
parent
db7f22d093
commit
215ea1428f
10 changed files with 358 additions and 0 deletions
30
MapsforgeTiles/WinUI/MapsforgeTileSource.WinUI.cs
Normal file
30
MapsforgeTiles/WinUI/MapsforgeTileSource.WinUI.cs
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
#if UWP
|
||||
using Windows.UI.Xaml.Media.Imaging;
|
||||
#elif WINUI
|
||||
using Microsoft.UI.Xaml.Media.Imaging;
|
||||
#endif
|
||||
|
||||
namespace MapControl.MapsforgeTiles
|
||||
{
|
||||
public partial class MapsforgeTileSource
|
||||
{
|
||||
private static WriteableBitmap CreateImage(int[] pixels)
|
||||
{
|
||||
var size = (int)Math.Sqrt(pixels.Length);
|
||||
var bitmap = new WriteableBitmap(size, size);
|
||||
|
||||
using var stream = bitmap.PixelBuffer.AsStream();
|
||||
using var writer = new BinaryWriter(stream);
|
||||
|
||||
foreach (var pixel in pixels)
|
||||
{
|
||||
writer.Write(pixel);
|
||||
}
|
||||
|
||||
return bitmap;
|
||||
}
|
||||
}
|
||||
}
|
||||
29
MapsforgeTiles/WinUI/MapsforgeTiles.WinUI.csproj
Normal file
29
MapsforgeTiles/WinUI/MapsforgeTiles.WinUI.csproj
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0-windows10.0.17763.0</TargetFramework>
|
||||
<UseWinUI>true</UseWinUI>
|
||||
<DefineConstants>WINUI</DefineConstants>
|
||||
<RootNamespace>MapControl.MapsforgeTiles</RootNamespace>
|
||||
<AssemblyTitle>XAML Map Control Mapsforge Library for WinUI</AssemblyTitle>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="..\Shared\*.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\MapControl\WinUI\MapControl.WinUI.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="IKVM" Version="8.15.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<IkvmReference Include="..\target\mapsforge-tilerenderer-0.1.0-jar-with-dependencies.jar" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
|
||||
<Exec Command="cd ..
mvn package" />
|
||||
</Target>
|
||||
</Project>
|
||||
Loading…
Add table
Add a link
Reference in a new issue