Skip to content

Commit 87f38e7

Browse files
committed
small update
1 parent 03b9081 commit 87f38e7

File tree

8 files changed

+55
-18
lines changed

8 files changed

+55
-18
lines changed

Build/SampleBuilder/Models/Sample.cs

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ public string Id
2727

2828
public string Author { get; set; }
2929

30+
public string Version { get; set; }
31+
3032
public DateTime LastChangeDate { get; set; }
3133
}
3234
}

Build/SampleBuilder/Program.cs

+36-3
Original file line numberDiff line numberDiff line change
@@ -138,17 +138,44 @@ static void WriteStartPage(string filename)
138138
string categoryList = "";
139139
foreach(var category in database.Categories)
140140
{
141-
categoryList += $"<li><a class=\"dropdown-item\" href=\"#{category.Id}\">{category.Title}</a></li>";
141+
categoryList += $"""
142+
<li>
143+
<a class=\"dropdown-item\" href=\"#{category.Id}\">{category.Title}</a>
144+
</li>
145+
""";
142146
}
143147

144148
string sampleList = "";
145149
foreach (var category in database.Categories)
146150
{
147-
sampleList += $"<div class=\"w-100\"><a name=\"{category.Id}\"></a><h3 class=\"fw-light\">{category.Title} <small class=\"text-muted\">({category.NumberOfSamples})</small></h3><p>{category.Description}</p></div>";
151+
sampleList += $"""
152+
<div class=\"w-100\">
153+
<a name=\"{category.Id}\"></a>
154+
<h3 class=\"fw-light\">{category.Title} <small class=\"text-muted\">({category.NumberOfSamples})</small></h3>
155+
<p>{category.Description}</p>
156+
</div>
157+
""";
148158

149159
foreach(var sample in category.Samples)
150160
{
151-
sampleList += $"<div class=\"col\"><div class=\"card shadow-sm\"><img class=\"card-img-top\" src=\"{sample.Path}/{sample.Screenshot}\" loading=\"lazy\" alt=\"{sample.Title}\" /><div class=\"card-body\"><h5 class=\"card-title\">{sample.Title}</h5><p class=\"card-text\">{sample.Description}</p><div class=\"d-flex justify-content-between align-items-center\"><div class=\"btn-group\"><button type=\"button\" class=\"btn btn-sm btn-outline-secondary\" data-bs-toggle=\"modal\" data-bs-target=\"#sampleModal\" data-bs-id=\"{sample.Id}\" data-bs-title=\"{sample.Title}\" data-bs-path=\"{sample.Path}\" data-bs-source=\"{database.GitHub}{sample.Source}\" aria-description=\"Run the sample in a new popup\"><small>Run Sample</small></button><a href=\"{sample.Path}\" target=\"_blank\" class=\"btn btn-sm btn-outline-secondary\" role=\"button\" aria-description=\"Open the sample in a new Tab\"><small>Open In New Tab</small></a><a href=\"{database.GitHub}{sample.Source}\" target=\"_blank\" class=\"btn btn-sm btn-outline-secondary\" role=\"button\" aria-description=\"Show the source code of the sample\"><small>Source Code</small></a></div></div></div></div></div>";
161+
sampleList += $"""
162+
<div class=\"col\">
163+
<div class=\"card shadow-sm\">
164+
<img class=\"card-img-top\" src=\"{sample.Path}/{sample.Screenshot}\" loading=\"lazy\" alt=\"{sample.Title}\" />
165+
<div class=\"card-body\">
166+
<h5 class=\"card-title\">{sample.Title}</h5>
167+
<p class=\"card-text\">{sample.Description}</p>
168+
<div class=\"d-flex justify-content-between align-items-center\">
169+
<div class=\"btn-group\">
170+
<button type=\"button\" class=\"btn btn-sm btn-outline-secondary\" data-bs-toggle=\"modal\" data-bs-target=\"#sampleModal\" data-bs-id=\"{sample.Id}\" data-bs-title=\"{sample.Title}\" data-bs-path=\"{sample.Path}\" data-bs-source=\"{database.GitHub}{sample.Source}\" aria-describedby=\"Run the sample in a new popup\"><small>Run Sample</small></button>
171+
<a href=\"{sample.Path}\" target=\"_blank\" class=\"btn btn-sm btn-outline-secondary\" role=\"button\" aria-describedby=\"Open the sample in a new Tab\"><small>Open In New Tab</small></a>
172+
<a href=\"{database.GitHub}{sample.Source}\" target=\"_blank\" class=\"btn btn-sm btn-outline-secondary\" role=\"button\" aria-describedby=\"Show the source code of the sample\"><small>Source Code</small></a>
173+
</div>
174+
</div>
175+
</div>
176+
</div>
177+
</div>
178+
""";
152179
}
153180
}
154181

@@ -262,6 +289,12 @@ static Sample GetSampleDetails(string filename)
262289
else
263290
sample.Screenshot = screenshot.Attributes["content"].Value;
264291

292+
var version = doc.DocumentNode.SelectSingleNode("//meta[@name='version']");
293+
if (version == null)
294+
Exit($"Missing version in file '{filename}'");
295+
else
296+
sample.Version = version.Attributes["content"].Value;
297+
265298
return sample;
266299
}
267300

Build/SampleBuilder/SampleBuilder.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
<TargetFramework>net7.0</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>disable</Nullable>
8-
<FileVersion>1.2.0.0</FileVersion>
9-
<AssemblyVersion>1.2.0.0</AssemblyVersion>
8+
<FileVersion>1.3.0.0</FileVersion>
9+
<AssemblyVersion>1.3.0.0</AssemblyVersion>
1010
</PropertyGroup>
1111

1212
<ItemGroup>
1313
<PackageReference Include="HtmlAgilityPack" Version="1.11.46" />
1414
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
15-
<PackageReference Include="xsitemap" Version="2.7.0" />
15+
<PackageReference Include="xsitemap" Version="2.8.0" />
1616
</ItemGroup>
1717

1818
<ItemGroup>
Loading

Samples/REST Services/Route Waypoint Optimization/Route Waypoint Optimization.html

+4-3
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
<title>Route Waypoint Optimization - Azure Maps Web SDK Samples</title>
55

66
<meta charset="utf-8" />
7-
<link rel="shortcut icon" href="/favicon.ico"/>
8-
7+
<link rel="shortcut icon" href="/favicon.ico" />
8+
99
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
1010
<meta name="description" content="This sample shows how to calculate routes with and without waypoint optimization using the Azure Maps REST Route API." />
1111
<meta name="keywords" content="Microsoft maps, map, gis, API, SDK, route directions service, direcitons, travelling salesmen problem, route optimization, optimize, vehicle routing problem, VRP, TSP" />
1212
<meta name="author" content="Microsoft Azure Maps" />
13+
<meta name="version" content="1.0" />
1314
<meta name="screenshot" content="screenshot.jpg" />
1415

1516
<!-- Add references to the Azure Maps Map control JavaScript and CSS files. -->
@@ -133,7 +134,7 @@
133134
pinOrder.push(r.optimizedWaypoints[i].optimizedIndex + 1);
134135
}
135136

136-
//Add the desintation index to the end.
137+
//Add the desintation index to the end.
137138
pinOrder.push(waypoints.length - 1);
138139

139140
output += 'Waypoint Order: ' + pinOrder.join(', ');

Samples/Spatial Math/Cardinal Spline Options/Cardinal Spline Options.html

+8-7
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
<title>Cardinal Spline Options - Azure Maps Web SDK Samples</title>
55

66
<meta charset="utf-8" />
7-
<link rel="shortcut icon" href="/favicon.ico"/>
8-
7+
<link rel="shortcut icon" href="/favicon.ico" />
8+
99
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
1010
<meta name="description" content="This sample provides a set of controls to test the various features of the Cardinal Spline calculation." />
1111
<meta name="keywords" content="Microsoft maps, map, gis, API, SDK, spatial math, math, spline, cardinal spline, curves, lines, line layer" />
1212
<meta name="author" content="Microsoft Azure Maps" />
13+
<meta name="version" content="1.0" />
1314
<meta name="screenshot" content="screenshot.jpg" />
1415

1516
<!-- Add references to the Azure Maps Map control JavaScript and CSS files. -->
@@ -26,7 +27,7 @@
2627
[-122.109186, 47.608526],
2728
[-122.111589, 47.580163]
2829
];
29-
30+
3031
function GetMap() {
3132
//Initialize a map instance.
3233
map = new atlas.Map('myMap', {
@@ -68,7 +69,7 @@
6869
})
6970
);
7071

71-
//Create to line shapes for easy updating. A red straightline will be created to show the straight line path between the points.
72+
//Create to line shapes for easy updating. A red straightline will be created to show the straight line path between the points.
7273
straightLine = new atlas.Shape(new atlas.data.LineString(positions), null, {
7374
color: 'red',
7475
width: 2
@@ -82,7 +83,7 @@
8283
//Add the lines to the data source.
8384
datasource.add([straightLine, spline]);
8485

85-
//Create a draggable HTML marker for each position.
86+
//Create a draggable HTML marker for each position.
8687
for (var i = 0; i < positions.length; i++) {
8788
var marker = new atlas.HtmlMarker({
8889
draggable: true,
@@ -108,10 +109,10 @@
108109
positions[e.target.properties.index] = e.target.getOptions().position;
109110

110111
//Calculate the cardinal spline coordinates and update the spline.
111-
spline.setCoordinates(atlas.math.getCardinalSpline(positions, tension, nodeSize, close));
112+
spline.setCoordinates(atlas.math.getCardinalSpline(positions, tension, nodeSize, close));
112113

113114
//Update the lines with the new positions.
114-
straightLine.setCoordinates(positions);
115+
straightLine.setCoordinates(positions);
115116
}
116117

117118
function calculateSpline() {

Static/js/site.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function showSampleCards() {
2121
$.each(data.Categories, function (index, value) {
2222
$('#sampleList').append(`<div class="w-100"><a name="${value.Id}"></a><h3 class="fw-light">${value.Title} <small class="text-muted">(${value.NumberOfSamples})</small></h3><p>${value.Description}</p></div>`);
2323
$.each(value.Samples, function (index, value) {
24-
$('#sampleList').append(`<div class="col"><div class="card shadow-sm"><img class="card-img-top" src="${value.Path}/${value.Screenshot}" loading="lazy" alt="${value.Title}" /><div class="card-body"><h5 class="card-title">${value.Title}</h5><p class="card-text">${value.Description}</p><div class="d-flex justify-content-between align-items-center"><div class="btn-group"><button type="button" class="btn btn-sm btn-outline-secondary" data-bs-toggle="modal" aria-description="Run the sample in a new popup" data-bs-target="#sampleModal" data-bs-id="${value.Id}" data-bs-title="${value.Title}" data-bs-path="${value.Path}" data-bs-source="${data.GitHub}${value.Source}"><small>Run Sample</small></button><a href="${value.Path}" target="_blank" class="btn btn-sm btn-outline-secondary" role="button" aria-description="Open sample in a new Tab"><small>Open In New Tab</small></a><a href="${data.GitHub}${value.Source}" target="_blank" class="btn btn-sm btn-outline-secondary" role="button" aria-description="Show the Source Code"><small>Source Code</small></a></div></div></div></div></div>`);
24+
$('#sampleList').append(`<div class="col"><div class="card shadow-sm"><img class="card-img-top" src="${value.Path}/${value.Screenshot}" loading="lazy" alt="${value.Title}" /><div class="card-body"><h5 class="card-title">${value.Title}</h5><p class="card-text">${value.Description}</p><div class="d-flex justify-content-between align-items-center"><div class="btn-group"><button type="button" class="btn btn-sm btn-outline-secondary" data-bs-toggle="modal" aria-describedby="Run the sample in a new popup" data-bs-target="#sampleModal" data-bs-id="${value.Id}" data-bs-title="${value.Title}" data-bs-path="${value.Path}" data-bs-source="${data.GitHub}${value.Source}"><small>Run Sample</small></button><a href="${value.Path}" target="_blank" class="btn btn-sm btn-outline-secondary" role="button" aria-describedby="Open sample in a new Tab"><small>Open In New Tab</small></a><a href="${data.GitHub}${value.Source}" target="_blank" class="btn btn-sm btn-outline-secondary" role="button" aria-describedby="Show the Source Code"><small>Source Code</small></a></div></div></div></div></div>`);
2525
});
2626
});
2727
}

0 commit comments

Comments
 (0)