Skip to content

Commit c4d77d5

Browse files
arnaudleclercmtech-rherpioCopilotCopilot
authored
Releases/1.18.0 (#119)
* Add ability to add and remove shapes from drawing manager data source (#110) * Add Drawing Manager component that can be used to add or remove shapes from drawing manager datasource * Add sample page for adding and removing shapes. * Add tests for DrawingManager. * Upgrade projects to supported .NET versions (net8.0, net9.0, net10.0) (#115) - Drop net6.0 (EOL Nov 2024) and net7.0 (EOL May 2024) - Add net9.0 and net10.0 target frameworks to library and test projects - Update sample project to target net10.0 - Add per-TFM package references for net9.0 and net10.0 - Upgrade bunit from 1.26.64 to 1.37.7 for .NET 9/10 compatibility - Update all CI workflows to set up .NET 8.0, 9.0, and 10.0 SDKs Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Enable NuGet publish step in release workflow (#116) Re-enable the commented-out dotnet nuget push step in release.yml. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Trigger release workflow on changes to itself (#117) Add .github/workflows/release.yml to the paths filter so the workflow also runs when the release workflow file itself is modified. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix missing static web assets in NuGet package (#118) The Razor SDK generates the static web assets manifest at dotnet build time. Previously, npm run build (which outputs the JS files to wwwroot/) ran after dotnet build, so the manifest was generated with an empty wwwroot/ and dotnet pack --no-build reused that stale manifest. Fix by moving the npm install/lint/build steps before dotnet restore and dotnet build, ensuring the compiled JS files exist in wwwroot/ when the static web assets manifest is generated. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Remove unused `_sourceShapes` field from `DrawingManager` (#121) * Initial plan * Remove unused _sourceShapes field from DrawingManager to reduce memory overhead Co-authored-by: arnaudleclerc <9578038+arnaudleclerc@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: arnaudleclerc <9578038+arnaudleclerc@users.noreply.github.com> --------- Co-authored-by: mtech-rherpio <166818039+mtech-rherpio@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: arnaudleclerc <9578038+arnaudleclerc@users.noreply.github.com>
1 parent ef97648 commit c4d77d5

File tree

13 files changed

+596
-51
lines changed

13 files changed

+596
-51
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@ jobs:
2121

2222
steps:
2323
- uses: actions/checkout@v2
24-
- name: Setup .NET 6.0
24+
- name: Setup .NET 8.0
2525
uses: actions/setup-dotnet@v1
2626
with:
27-
dotnet-version: 6.0.x
28-
- name: Setup .NET 7.0
27+
dotnet-version: 8.0.x
28+
- name: Setup .NET 9.0
2929
uses: actions/setup-dotnet@v1
3030
with:
31-
dotnet-version: 7.0.x
32-
- name: Setup .NET 8.0
31+
dotnet-version: 9.0.x
32+
- name: Setup .NET 10.0
3333
uses: actions/setup-dotnet@v1
3434
with:
35-
dotnet-version: 8.0.x
35+
dotnet-version: 10.0.x
3636
- name: Install dependencies
3737
run: dotnet restore ./src/AzureMapsControl.Components/AzureMapsControl.Components.csproj
3838
- name: Build

.github/workflows/code-coverage.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,18 @@ jobs:
2727

2828
steps:
2929
- uses: actions/checkout@v2
30-
- name: Setup .NET 6.0
30+
- name: Setup .NET 8.0
3131
uses: actions/setup-dotnet@v1
3232
with:
33-
dotnet-version: 6.0.x
34-
- name: Setup .NET 7.0
33+
dotnet-version: 8.0.x
34+
- name: Setup .NET 9.0
3535
uses: actions/setup-dotnet@v1
3636
with:
37-
dotnet-version: 7.0.x
38-
- name: Setup .NET 8.0
37+
dotnet-version: 9.0.x
38+
- name: Setup .NET 10.0
3939
uses: actions/setup-dotnet@v1
4040
with:
41-
dotnet-version: 8.0.x
41+
dotnet-version: 10.0.x
4242
- name: Install dependencies
4343
run: dotnet restore ./src/AzureMapsControl.Components/AzureMapsControl.Components.csproj
4444
- name: Build

.github/workflows/release.yml

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
- main
1010
paths:
1111
- src/**
12+
- .github/workflows/release.yml
1213

1314
jobs:
1415
build:
@@ -20,38 +21,34 @@ jobs:
2021
uses: actions/checkout@v2
2122
with:
2223
fetch-depth: 0
23-
- name: Setup .NET 6.0
24-
uses: actions/setup-dotnet@v1
25-
with:
26-
dotnet-version: 6.0.x
27-
- name: Setup .NET 7.0
28-
uses: actions/setup-dotnet@v1
29-
with:
30-
dotnet-version: 7.0.x
3124
- name: Setup .NET 8.0
3225
uses: actions/setup-dotnet@v1
3326
with:
3427
dotnet-version: 8.0.x
35-
- name: Setup .NET Core 3.1
28+
- name: Setup .NET 9.0
29+
uses: actions/setup-dotnet@v1
30+
with:
31+
dotnet-version: 9.0.x
32+
- name: Setup .NET 10.0
3633
uses: actions/setup-dotnet@v1
3734
with:
38-
dotnet-version: 3.1.x
35+
dotnet-version: 10.0.x
3936
- name: Install GitVersion
4037
uses: gittools/actions/gitversion/setup@v0.9.11
4138
with:
4239
versionSpec: '5.x'
43-
- name: Install dependencies
44-
run: dotnet restore ./src/AzureMapsControl.Components/AzureMapsControl.Components.csproj
45-
- name: Build
46-
run: dotnet build --configuration Release --no-restore ./src/AzureMapsControl.Components/AzureMapsControl.Components.csproj
47-
- name: Test
48-
run: dotnet test ./tests/AzureMapsControl.Components.Tests/AzureMapsControl.Components.Tests.csproj
4940
- name: NPM Install
5041
run: cd ./src/AzureMapsControl.Components && npm i
5142
- name: Lint
5243
run: cd ./src/AzureMapsControl.Components && npm run lint
5344
- name: Build Typescript
5445
run: cd ./src/AzureMapsControl.Components && npm run build
46+
- name: Install dependencies
47+
run: dotnet restore ./src/AzureMapsControl.Components/AzureMapsControl.Components.csproj
48+
- name: Build
49+
run: dotnet build --configuration Release --no-restore ./src/AzureMapsControl.Components/AzureMapsControl.Components.csproj
50+
- name: Test
51+
run: dotnet test ./tests/AzureMapsControl.Components.Tests/AzureMapsControl.Components.Tests.csproj
5552
- name: Use GitVersion
5653
id: gitversion # step id used as reference for output values
5754
uses: gittools/actions/gitversion/execute@v0.9.11
@@ -106,7 +103,7 @@ jobs:
106103
- name: Pack
107104
if: ${{ steps.gitversion.outputs.branchName == 'master' || steps.gitversion.outputs.branchName == 'main' }}
108105
run: dotnet pack ./src/AzureMapsControl.Components/AzureMapsControl.Components.csproj -p:Version='${{ steps.gitversion.outputs.majorMinorPatch }}"' -c Release --no-build
109-
# - name: Publish
110-
# env :
111-
# NUGETAPIKEY: ${{secrets.NUGETAPIKEY}}
112-
# run: dotnet nuget push "**/AzureMapsControl.Components*.nupkg" -s https://api.nuget.org/v3/index.json -k $NUGETAPIKEY --skip-duplicate
106+
- name: Publish
107+
env:
108+
NUGETAPIKEY: ${{secrets.NUGETAPIKEY}}
109+
run: dotnet nuget push "**/AzureMapsControl.Components*.nupkg" -s https://api.nuget.org/v3/index.json -k $NUGETAPIKEY --skip-duplicate

.github/workflows/unit-tests.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@ jobs:
2626

2727
steps:
2828
- uses: actions/checkout@v2
29-
- name: Setup .NET 6.0
29+
- name: Setup .NET 8.0
3030
uses: actions/setup-dotnet@v1
3131
with:
32-
dotnet-version: 6.0.x
33-
- name: Setup .NET 7.0
32+
dotnet-version: 8.0.x
33+
- name: Setup .NET 9.0
3434
uses: actions/setup-dotnet@v1
3535
with:
36-
dotnet-version: 7.0.x
37-
- name: Setup .NET 8.0
36+
dotnet-version: 9.0.x
37+
- name: Setup .NET 10.0
3838
uses: actions/setup-dotnet@v1
3939
with:
40-
dotnet-version: 8.0.x
40+
dotnet-version: 10.0.x
4141
- name: Install dependencies
4242
run: dotnet restore ./src/AzureMapsControl.Components/AzureMapsControl.Components.csproj
4343
- name: Build

samples/AzureMapsControl.Sample/AzureMapsControl.Sample.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
</PropertyGroup>

samples/AzureMapsControl.Sample/Components/Layout/NavMenu.razor

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@
8686
<li>
8787
<NavLink class="dropdown-item" href="/Drawing/DrawingToolbarUpdate"> Toolbar update </NavLink>
8888
</li>
89+
<li>
90+
<NavLink class="dropdown-item" href="/Drawing/DrawingManagerLoadData"> Load data to drawing manager </NavLink>
91+
</li>
8992
</ul>
9093
</li>
9194
<NavLink class="nav-link" href="Indoor"> Indoor </NavLink>
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
@page "/Drawing/DrawingManagerLoadData"
2+
@rendermode InteractiveServer
3+
4+
@using AzureMapsControl.Components.Atlas
5+
@using AzureMapsControl.Components.Drawing
6+
@using AzureMapsControl.Components.Map
7+
8+
9+
<AzureMap Id="map"
10+
OnReady="MapReady"
11+
EventActivationFlags="MapEventActivationFlags.None().Enable(MapEventType.Ready)" />
12+
<div style="position: absolute; bottom: 10px; left: 10px; z-index: 1;">
13+
<button @onclick="AddRandomShape">Add Random Shape</button>
14+
<button @onclick="ClearShapes">Clear Shapes</button>
15+
</div>
16+
17+
18+
@code {
19+
private DrawingManager? _drawingManager;
20+
private Position _center = new Position(-122.33, 47.6);
21+
22+
public async Task MapReady(MapEventArgs eventArgs)
23+
{
24+
await eventArgs.Map.SetCameraOptionsAsync(options =>
25+
{
26+
options.Zoom = 10;
27+
options.Center = _center;
28+
});
29+
await eventArgs.Map.AddDrawingToolbarAsync(new AzureMapsControl.Components.Drawing.DrawingToolbarOptions
30+
{
31+
Buttons = new[]
32+
{
33+
AzureMapsControl.Components.Drawing.DrawingButton.DrawCircle,
34+
AzureMapsControl.Components.Drawing.DrawingButton.DrawLine,
35+
AzureMapsControl.Components.Drawing.DrawingButton.EditGeometry
36+
},
37+
Position = AzureMapsControl.Components.Controls.ControlPosition.TopRight,
38+
Style = AzureMapsControl.Components.Drawing.DrawingToolbarStyle.Dark
39+
});
40+
41+
var lineString = new AzureMapsControl.Components.Atlas.LineString(new[]
42+
{
43+
new AzureMapsControl.Components.Atlas.Position(-122.27577, 47.55938),
44+
new AzureMapsControl.Components.Atlas.Position(-122.29705, 47.60662),
45+
new AzureMapsControl.Components.Atlas.Position(-122.22358, 47.6367)
46+
});
47+
var shape = new AzureMapsControl.Components.Atlas.Shape<AzureMapsControl.Components.Atlas.LineString>(lineString);
48+
_drawingManager = eventArgs.Map.DrawingManager;
49+
await _drawingManager.AddShapesAsync(new[] { shape });
50+
}
51+
52+
private async Task AddRandomShape()
53+
{
54+
if (_drawingManager == null) return;
55+
56+
var random = new Random();
57+
var shapeType = random.Next(3);
58+
Shape shape;
59+
var numberOfPoints = random.Next(3, 5);
60+
var center = new Position(_center.Longitude + (random.NextDouble()-0.5) * 0.6, _center.Latitude + (random.NextDouble()-0.5) * 0.4);
61+
62+
switch (shapeType)
63+
{
64+
case 0: // Circle
65+
var radius = random.NextDouble() * 2000;
66+
shape = new Shape<Point>(new Point(center), new Dictionary<string, object>
67+
{
68+
{ "subType", "Circle" },
69+
{ "radius", radius }
70+
});
71+
break;
72+
case 1: // Polygon
73+
var polygonPositions = new List<Position>();
74+
for (var i = 0; i < numberOfPoints; i++)
75+
{
76+
polygonPositions.Add(new Position(center.Longitude + (random.NextDouble()-0.5) * 0.1, center.Latitude + (random.NextDouble()-0.5) * 0.1));
77+
}
78+
polygonPositions.Add(polygonPositions[0]);
79+
shape = new Shape<Polygon>(new Polygon(new[] { polygonPositions }));
80+
break;
81+
case 2: // Polyline
82+
var polylinePositions = new List<Position>();
83+
for (var i = 0; i < numberOfPoints; i++)
84+
{
85+
polylinePositions.Add(new Position(center.Longitude + (random.NextDouble()-0.5) * 0.1, center.Latitude + (random.NextDouble()-0.5) * 0.1));
86+
}
87+
shape = new Shape<LineString>(new LineString(polylinePositions));
88+
break;
89+
default:
90+
return;
91+
}
92+
93+
await _drawingManager.AddShapesAsync(new[] { shape });
94+
}
95+
96+
private async Task ClearShapes()
97+
{
98+
if (_drawingManager != null)
99+
{
100+
await _drawingManager.ClearAsync();
101+
}
102+
}
103+
}

src/AzureMapsControl.Components/AzureMapsControl.Components.csproj

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
4+
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
55
<RazorLangVersion>3.0</RazorLangVersion>
66
<Authors>Arnaud Leclerc</Authors>
77
<Company />
@@ -37,19 +37,19 @@
3737
<None Include="tsconfig.json" />
3838
</ItemGroup>
3939

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

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

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

5555
</Project>

0 commit comments

Comments
 (0)