Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Setup .NET 6.0
- name: Setup .NET 8.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Setup .NET 7.0
dotnet-version: 8.0.x
- name: Setup .NET 9.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.x
- name: Setup .NET 8.0
dotnet-version: 9.0.x
- name: Setup .NET 10.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
dotnet-version: 10.0.x
- name: Install dependencies
run: dotnet restore ./src/AzureMapsControl.Components/AzureMapsControl.Components.csproj
- name: Build
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Setup .NET 6.0
- name: Setup .NET 8.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Setup .NET 7.0
dotnet-version: 8.0.x
- name: Setup .NET 9.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.x
- name: Setup .NET 8.0
dotnet-version: 9.0.x
- name: Setup .NET 10.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
dotnet-version: 10.0.x
- name: Install dependencies
run: dotnet restore ./src/AzureMapsControl.Components/AzureMapsControl.Components.csproj
- name: Build
Expand Down
37 changes: 17 additions & 20 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
- main
paths:
- src/**
- .github/workflows/release.yml

jobs:
build:
Expand All @@ -20,38 +21,34 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET 6.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Setup .NET 7.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.x
- name: Setup .NET 8.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
- name: Setup .NET Core 3.1
- name: Setup .NET 9.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 9.0.x
- name: Setup .NET 10.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x
dotnet-version: 10.0.x
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.9.11
with:
versionSpec: '5.x'
- name: Install dependencies
run: dotnet restore ./src/AzureMapsControl.Components/AzureMapsControl.Components.csproj
- name: Build
run: dotnet build --configuration Release --no-restore ./src/AzureMapsControl.Components/AzureMapsControl.Components.csproj
- name: Test
run: dotnet test ./tests/AzureMapsControl.Components.Tests/AzureMapsControl.Components.Tests.csproj
- name: NPM Install
run: cd ./src/AzureMapsControl.Components && npm i
- name: Lint
run: cd ./src/AzureMapsControl.Components && npm run lint
- name: Build Typescript
run: cd ./src/AzureMapsControl.Components && npm run build
- name: Install dependencies
run: dotnet restore ./src/AzureMapsControl.Components/AzureMapsControl.Components.csproj
- name: Build
run: dotnet build --configuration Release --no-restore ./src/AzureMapsControl.Components/AzureMapsControl.Components.csproj
- name: Test
run: dotnet test ./tests/AzureMapsControl.Components.Tests/AzureMapsControl.Components.Tests.csproj
- name: Use GitVersion
id: gitversion # step id used as reference for output values
uses: gittools/actions/gitversion/execute@v0.9.11
Expand Down Expand Up @@ -106,7 +103,7 @@ jobs:
- name: Pack
if: ${{ steps.gitversion.outputs.branchName == 'master' || steps.gitversion.outputs.branchName == 'main' }}
run: dotnet pack ./src/AzureMapsControl.Components/AzureMapsControl.Components.csproj -p:Version='${{ steps.gitversion.outputs.majorMinorPatch }}"' -c Release --no-build
# - name: Publish
# env :
# NUGETAPIKEY: ${{secrets.NUGETAPIKEY}}
# run: dotnet nuget push "**/AzureMapsControl.Components*.nupkg" -s https://api.nuget.org/v3/index.json -k $NUGETAPIKEY --skip-duplicate
- name: Publish
env:
NUGETAPIKEY: ${{secrets.NUGETAPIKEY}}
run: dotnet nuget push "**/AzureMapsControl.Components*.nupkg" -s https://api.nuget.org/v3/index.json -k $NUGETAPIKEY --skip-duplicate
12 changes: 6 additions & 6 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Setup .NET 6.0
- name: Setup .NET 8.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Setup .NET 7.0
dotnet-version: 8.0.x
- name: Setup .NET 9.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.x
- name: Setup .NET 8.0
dotnet-version: 9.0.x
- name: Setup .NET 10.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
dotnet-version: 10.0.x
- name: Install dependencies
run: dotnet restore ./src/AzureMapsControl.Components/AzureMapsControl.Components.csproj
- name: Build
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@
<li>
<NavLink class="dropdown-item" href="/Drawing/DrawingToolbarUpdate"> Toolbar update </NavLink>
</li>
<li>
<NavLink class="dropdown-item" href="/Drawing/DrawingManagerLoadData"> Load data to drawing manager </NavLink>
</li>
</ul>
</li>
<NavLink class="nav-link" href="Indoor"> Indoor </NavLink>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
@page "/Drawing/DrawingManagerLoadData"
@rendermode InteractiveServer

@using AzureMapsControl.Components.Atlas
@using AzureMapsControl.Components.Drawing
@using AzureMapsControl.Components.Map


<AzureMap Id="map"
OnReady="MapReady"
EventActivationFlags="MapEventActivationFlags.None().Enable(MapEventType.Ready)" />
<div style="position: absolute; bottom: 10px; left: 10px; z-index: 1;">
<button @onclick="AddRandomShape">Add Random Shape</button>
<button @onclick="ClearShapes">Clear Shapes</button>
</div>


@code {
private DrawingManager? _drawingManager;
private Position _center = new Position(-122.33, 47.6);

public async Task MapReady(MapEventArgs eventArgs)
{
await eventArgs.Map.SetCameraOptionsAsync(options =>
{
options.Zoom = 10;
options.Center = _center;
});
await eventArgs.Map.AddDrawingToolbarAsync(new AzureMapsControl.Components.Drawing.DrawingToolbarOptions
{
Buttons = new[]
{
AzureMapsControl.Components.Drawing.DrawingButton.DrawCircle,
AzureMapsControl.Components.Drawing.DrawingButton.DrawLine,
AzureMapsControl.Components.Drawing.DrawingButton.EditGeometry
},
Position = AzureMapsControl.Components.Controls.ControlPosition.TopRight,
Style = AzureMapsControl.Components.Drawing.DrawingToolbarStyle.Dark
});

var lineString = new AzureMapsControl.Components.Atlas.LineString(new[]
{
new AzureMapsControl.Components.Atlas.Position(-122.27577, 47.55938),
new AzureMapsControl.Components.Atlas.Position(-122.29705, 47.60662),
new AzureMapsControl.Components.Atlas.Position(-122.22358, 47.6367)
});
var shape = new AzureMapsControl.Components.Atlas.Shape<AzureMapsControl.Components.Atlas.LineString>(lineString);
_drawingManager = eventArgs.Map.DrawingManager;
await _drawingManager.AddShapesAsync(new[] { shape });
}

private async Task AddRandomShape()
{
if (_drawingManager == null) return;

var random = new Random();
var shapeType = random.Next(3);
Shape shape;
var numberOfPoints = random.Next(3, 5);
var center = new Position(_center.Longitude + (random.NextDouble()-0.5) * 0.6, _center.Latitude + (random.NextDouble()-0.5) * 0.4);

switch (shapeType)
{
case 0: // Circle
var radius = random.NextDouble() * 2000;
shape = new Shape<Point>(new Point(center), new Dictionary<string, object>
{
{ "subType", "Circle" },
{ "radius", radius }
});
break;
case 1: // Polygon
var polygonPositions = new List<Position>();
for (var i = 0; i < numberOfPoints; i++)
{
polygonPositions.Add(new Position(center.Longitude + (random.NextDouble()-0.5) * 0.1, center.Latitude + (random.NextDouble()-0.5) * 0.1));
}
polygonPositions.Add(polygonPositions[0]);
shape = new Shape<Polygon>(new Polygon(new[] { polygonPositions }));
break;
case 2: // Polyline
var polylinePositions = new List<Position>();
for (var i = 0; i < numberOfPoints; i++)
{
polylinePositions.Add(new Position(center.Longitude + (random.NextDouble()-0.5) * 0.1, center.Latitude + (random.NextDouble()-0.5) * 0.1));
}
shape = new Shape<LineString>(new LineString(polylinePositions));
break;
default:
return;
}

await _drawingManager.AddShapesAsync(new[] { shape });
}

private async Task ClearShapes()
{
if (_drawingManager != null)
{
await _drawingManager.ClearAsync();
}
}
}
20 changes: 10 additions & 10 deletions src/AzureMapsControl.Components/AzureMapsControl.Components.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
<RazorLangVersion>3.0</RazorLangVersion>
<Authors>Arnaud Leclerc</Authors>
<Company />
Expand Down Expand Up @@ -37,19 +37,19 @@
<None Include="tsconfig.json" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="6.0.25" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0.0" />
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="7.0.14" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="7.0.0" />
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="9.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="10.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="10.0.0" />
</ItemGroup>

</Project>
Loading
Loading