Skip to content

Commit daad648

Browse files
Reworking way of setting the options on the map
* Adding SetStyleOptionsAsync on map * Adding SetUserInteractionAsync on Map * Adding SetTrafficAsync on Map * Reworking CameraOptions binding on map * Reworking StyleOptions bindings on map * Reworking UserInteractionOptions bindings on map * Reworking ServiceOptions * Updating docs
1 parent 39cfdd3 commit daad648

45 files changed

Lines changed: 770 additions & 421 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/layers/README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ Layers can be added to the map after the `MapReady` event has been triggered by
1717
1818
@using AzureMapsControl.Components.Map
1919
<AzureMap Id="map"
20-
Center="new Components.Atlas.Position(-99.47, 40.75)"
21-
Zoom="4"
20+
CameraOptions="new CameraOptions { Center = new Components.Atlas.Position(-99.47, 40.75), Zoom = 4}"
2221
EventActivationFlags="MapEventActivationFlags
2322
.None()
2423
.Enable(MapEventType.Ready)"
@@ -64,8 +63,7 @@ Layers can be removed by calling the `RemoveLayersAsync` method on the map and p
6463
6564
@using AzureMapsControl.Components.Map
6665
<AzureMap Id="map"
67-
Center="new Components.Atlas.Position(-99.47, 40.75)"
68-
Zoom="4"
66+
CameraOptions="new CameraOptions { Center = new Components.Atlas.Position(-99.47, 40.75), Zoom = 4 } "
6967
EventActivationFlags="MapEventActivationFlags
7068
.None()
7169
.Enable(MapEventType.Ready)"

docs/layers/bubblelayer/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The `Bubble Layer` requires a data source. The ID of the datasource to bind to t
1111
1212
@using AzureMapsControl.Components.Map
1313
<AzureMap Id="map"
14-
Zoom="2"
14+
CameraOptions="new CameraOptions { Zoom = 2 }"
1515
EventActivationFlags="MapEventActivationFlags
1616
.None()
1717
.Enable(MapEventType.Ready)"

docs/layers/heatmaplayer/README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,20 @@ The `Heatmap Layer` requires a data source. The ID of the datasource to bind to
1111
1212
@using AzureMapsControl.Components.Map
1313
<AzureMap Id="map"
14-
Zoom="2"
15-
Style="grayscale_dark"
14+
CameraOptions="new CameraOptions { Zoom = 2 }"
15+
StyleOptions="StyleOptions"
1616
EventActivationFlags="MapEventActivationFlags
1717
.None()
1818
.Enable(MapEventType.Ready)"
1919
OnReady="OnMapReady" />
2020
2121
@code {
22+
23+
public StyleOptions StyleOptions = new StyleOptions
24+
{
25+
Style = "grayscale_dark"
26+
};
27+
2228
public async Task OnMapReady(MapEventArgs events)
2329
{
2430
const string dataSourceId = "heatmapDataSource";

docs/layers/imagelayer/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ The image layer supports the following image formats
1414
1515
@using AzureMapsControl.Components.Map
1616
<AzureMap Id="map"
17-
Center="new Components.Atlas.Position(11.575454, 48.137392)"
18-
Zoom="13"
17+
CameraOptions="new CameraOptions { Center = new Components.Atlas.Position(11.575454, 48.137392), Zoom = 13 }"
1918
EventActivationFlags="MapEventActivationFlags
2019
.None()
2120
.Enable(MapEventType.Ready)"

docs/layers/linelayer/README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,20 @@ A line layer can be used to render `LineString` and `MultiLineString` features a
99
1010
@using AzureMapsControl.Components.Map
1111
<AzureMap Id="map"
12-
Zoom="14"
13-
Center="new Components.Atlas.Position(11.581990, 48.143534)"
14-
Style="grayscale_dark"
12+
CameraOptions="new CameraOptions { Center = new Components.Atlas.Position(11.581990, 48.143534), Zoom = 14 }"
13+
StyleOptions="StyleOptions"
1514
EventActivationFlags="MapEventActivationFlags
1615
.None()
1716
.Enable(MapEventType.Ready)"
1817
OnReady="OnMapReady" />
1918
2019
@code {
20+
21+
public StyleOptions StyleOptions = new StyleOptions
22+
{
23+
Style = "grayscale_dark"
24+
};
25+
2126
public async Task OnMapReady(MapEventArgs events)
2227
{
2328
const string dataSourceId = "dataSource";

docs/layers/polygonextrusionlayer/README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ The polygon extrusion layer renders areas of `Polygon` and `MultiPolygon` featur
99
1010
@using AzureMapsControl.Components.Map
1111
<AzureMap Id="map"
12-
Zoom="4"
13-
Pitch="45"
14-
Center="new Components.Atlas.Position(11.581990, 48.143534)"
12+
CameraOptions="new CameraOptions { Center = new Components.Atlas.Position(11.581990, 48.143534), Zoom = 4, Pitch = 45 }"
1513
EventActivationFlags="MapEventActivationFlags
1614
.None()
1715
.Enable(MapEventType.Ready)"
@@ -24,7 +22,7 @@ The polygon extrusion layer renders areas of `Polygon` and `MultiPolygon` featur
2422
var dataSource = new AzureMapsControl.Components.Data.DataSource(dataSourceId);
2523
await events.Map.AddSourceAsync(dataSource);
2624
27-
await dataSource.ImportDataFromUrlAsync("https://raw.githubusercontent.com/arnaudleclerc/ng-azure-maps/master/assets/data/countries.geojson.json");
25+
await dataSource.ImportDataFromUrlAsync("https://raw.githubusercontent.com/arnaudleclerc/ng-azure-maps/main/assets/data/countries.geojson.json");
2826
2927
var layer = new AzureMapsControl.Components.Layers.PolygonExtrusionLayer
3028
{

docs/layers/polygonlayer/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ A Polygon Layer renders the areas of `Polygon` and `MultiPolygon` feature geomet
99
1010
@using AzureMapsControl.Components.Map
1111
<AzureMap Id="map"
12-
Zoom="2"
12+
CameraOptions="new CameraOptions { Zoom = 2 }"
1313
EventActivationFlags="MapEventActivationFlags
1414
.None()
1515
.Enable(MapEventType.Ready)"

docs/layers/symbollayer/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ Connect a symbol to a data source, and use it to render an icon or a text at a g
44

55
Symbol layers are rendered using WebGL. Use a symbol layer to render large collections of points on the map. Compared to HTML marker, the symbol layer renders a large number of point data on the map, with better performance. However, the symbol layer doesn't support traditional CSS and HTML elements for styling.
66

7-
![Symbol Layer](../assets/symbollayer.png)
7+
![Symbol Layer](../../assets/symbollayer.png)
88

99
```
1010
@page "/SymbolLayerOnReady"
1111
1212
@using AzureMapsControl.Components.Map
1313
<AzureMap Id="map"
14-
Zoom="2"
14+
CameraOptions="new CameraOptions { Zoom = 2 }"
1515
EventActivationFlags="MapEventActivationFlags
1616
.None()
1717
.Enable(MapEventType.Ready)"

docs/layers/tilelayer/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22

33
A Tile layer loads in tiles from a server. These images can either be pre-rendered or dynamically rendered. Pre-rendered images are stored like any other image on a server using a naming convention that the tile layer understands. Dynamically rendered images use a service to load the images close to real time.
44

5-
![Tile Layer](../assets/tilelayer.png)
5+
![Tile Layer](../../assets/tilelayer.png)
66

77
```
88
@page "/TileLayerOnReady"
99
1010
@using AzureMapsControl.Components.Map
1111
<AzureMap Id="map"
12-
Center="new Components.Atlas.Position(-99.47, 40.75)"
13-
Zoom="4"
12+
CameraOptions="new CameraOptions { Center = new Components.Atlas.Position(-99.47, 40.75), Zoom = 4}"
1413
EventActivationFlags="MapEventActivationFlags
1514
.None()
1615
.Enable(MapEventType.Ready)"

docs/map/README.md

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,17 @@ You can use the `AzureMap` component to display a map.
99
1010
@using AzureMapsControl.Components.Map
1111
<AzureMap Id="map"
12-
Center="new AzureMapsControl.Components.Atlas.Position(11.581990, 48.143534)"
13-
Zoom="10"
14-
Style="grayscale_dark"
15-
ShowLogo="false"
16-
ShowFeedbackLink="false" />
12+
CameraOptions="new CameraOptions { Center= new AzureMapsControl.Components.Atlas.Position(11.581990, 48.143534), Zoom= 10 }"
13+
StyleOptions="StyleOptions"/>
14+
15+
@code {
16+
public StyleOptions StyleOptions = new StyleOptions
17+
{
18+
Style = "grayscale_dark",
19+
ShowLogo = false,
20+
ShowFeedbackLink = false
21+
};
22+
}
1723
```
1824

1925
Different inputs can be specified to customize the map. Please refer to the [Azure Maps Web SDK Documentation](https://docs.microsoft.com/en-us/azure/azure-maps/map-create) for more information.
@@ -85,18 +91,24 @@ The following example activates all the events except `Drag`, `Idle`, `MouseMove
8591
8692
@using AzureMapsControl.Components.Map
8793
<AzureMap Id="map"
88-
Center="new AzureMapsControl.Components.Atlas.Position(11.581990, 48.143534)"
89-
Zoom="10"
90-
Style="grayscale_dark"
91-
ShowLogo="false"
92-
ShowFeedbackLink="false"
94+
CameraOptions="new CameraOptions { Center= new AzureMapsControl.Components.Atlas.Position(11.581990, 48.143534), Zoom= 10 }"
95+
StyleOptions="StyleOptions"
9396
OnReady="@(async (e) => { Console.WriteLine(e.Type); })"
9497
EventActivationFlags="MapEventActivationFlags
9598
.All()
9699
.Disable(MapEventType.Drag,
97100
MapEventType.Idle,
98101
MapEventType.MouseMove,
99102
MapEventType.Render)"/>
103+
104+
@code {
105+
public StyleOptions StyleOptions = new StyleOptions
106+
{
107+
Style = "grayscale_dark",
108+
ShowLogo = false,
109+
ShowFeedbackLink = false
110+
};
111+
}
100112
```
101113

102114
The following example deactivates all the events except `Ready`.
@@ -106,13 +118,19 @@ The following example deactivates all the events except `Ready`.
106118
107119
@using AzureMapsControl.Components.Map
108120
<AzureMap Id="map"
109-
Center="new AzureMapsControl.Components.Atlas.Position(11.581990, 48.143534)"
110-
Zoom="10"
111-
Style="grayscale_dark"
112-
ShowLogo="false"
113-
ShowFeedbackLink="false"
121+
CameraOptions="new CameraOptions { Center= new AzureMapsControl.Components.Atlas.Position(11.581990, 48.143534), Zoom= 10 }"
122+
StyleOptions="StyleOptions"
114123
OnReady="@(async (e) => { Console.WriteLine(e.Type); })"
115124
EventActivationFlags="MapEventActivationFlags
116125
.None()
117126
.Enable(MapEventType.Ready)"/>
127+
128+
@code {
129+
public StyleOptions StyleOptions = new StyleOptions
130+
{
131+
Style = "grayscale_dark",
132+
ShowLogo = false,
133+
ShowFeedbackLink = false
134+
};
135+
}
118136
```

0 commit comments

Comments
 (0)