Skip to content

Commit 149334e

Browse files
authored
Merge pull request #97017 from rbrundritt/master
Add videos, update samples
2 parents a546356 + 684ac7f commit 149334e

11 files changed

+126
-61
lines changed

articles/azure-maps/clustering-point-data-web-sdk.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ ms.custom: codepen
1515

1616
When visualizing many data points on the map, points overlap each other, the map looks cluttered and it becomes difficult to see and use. Clustering of point data can be used to improve this user experience. Clustering point data is the process of combining point data that are near each other and representing them on the map as a single clustered data point. As the user zooms into the map, the clusters break apart into their individual data points.
1717

18+
<br/>
19+
20+
<iframe src="https://channel9.msdn.com/Shows/Internet-of-Things-Show/Clustering-point-data-in-Azure-Maps/player" width="960" height="540" allowFullScreen frameBorder="0"></iframe>
21+
1822
## Enabling clustering on a data source
1923

2024
Clustering can easily be enabled on the `DataSource` class by setting the `cluster` option to true. Additionally, the pixel radius to select nearby points to combine into a cluster can be set using the `clusterRadius` and a zoom level can be specified at which to disable the clustering logic using the `clusterMaxZoom` option. Here is an example of how to enable clustering in a data source.

articles/azure-maps/data-driven-style-expressions-web-sdk.md

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -370,13 +370,32 @@ var layer = new atlas.layer.SymbolLayer(datasource, null, {
370370
});
371371
```
372372

373+
The following example uses a `coalesce` expression to retrieve the first available image icon available in the map sprite from a list of specified image names.
374+
375+
```javascript
376+
var layer = new atlas.layer.SymbolLayer(datasource, null, {
377+
iconOptions: {
378+
image: [
379+
'coalesce',
380+
381+
//Try getting the image with id 'missing-image'.
382+
['image', 'missing-image'],
383+
384+
//Specify an image id to fallback to.
385+
'marker-blue'
386+
]
387+
}
388+
});
389+
```
390+
373391
## Type expressions
374392

375393
Type expressions provide tools for testing and converting different data types like strings, numbers, and boolean values.
376394

377395
| Expression | Return type | Description |
378396
|------------|-------------|-------------|
379397
| `['literal', array]`<br/><br/>`['literal', object]` | array \| object | Returns a literal array or object value. Use this expression to prevent an array or object from being evaluated as an expression. This is necessary when an array or object needs to be returned by an expression. |
398+
| `['image', string]` | string | Checks to see if a specified image ID is loaded into the maps image sprite. If it is, the ID is returned, otherwise null is returned. |
380399
| `['to-boolean', value]` | boolean | Converts the input value to a boolean. The result is `false` when the input is an empty string, `0`, `false`, `null`, or `NaN`; otherwise its `true`. |
381400
| `['to-color', value]`<br/><br/>`['to-color', value1, value2…]` | color | Converts the input value to a color. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error. |
382401
| `['to-number', value]`<br/><br/>`['to-number', value1, value2, …]` | number | Converts the input value to a number, if possible. If the input is `null` or `false`, the result is 0. If the input is `true`, the result is 1. If the input is a string, it's converted to a number using the [ToNumber](https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type) string function of the ECMAScript Language Specification. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error. |
@@ -395,7 +414,7 @@ Type expressions provide tools for testing and converting different data types l
395414
> //Get the entityType value.
396415
> ['get', 'entityType'],
397416
>
398-
> //If there is no title, try getting the subtitle.
417+
> //If the entity type is 'restaurant', return a different pixel offset.
399418
> 'restaurant', ['literal', [0, -10]],
400419
>
401420
> //Default to value.
@@ -660,6 +679,7 @@ The text field format expression can be used with the `textField` option of the
660679

661680
* `'font-scale'` - Specifies the scaling factor for the font size. If specified, this value will override the `size` property of the `textOptions` for the individual string.
662681
* `'text-font'` - Specifies one or more font families that should be used for this string. If specified, this value will override the `font` property of the `textOptions` for the individual string.
682+
* `'text-color'` - Specifies a color to apply to a text when rendering.
663683

664684
The following pseudocode defines the structure of the text field format expression.
665685

@@ -669,20 +689,22 @@ The following pseudocode defines the structure of the text field format expressi
669689
input1: string,
670690
options1: {
671691
'font-scale': number,
672-
'text-font': string[]
692+
'text-font': string[],
693+
'text-color': color
673694
},
674695
input2: string,
675696
options2: {
676697
'font-scale': number,
677-
'text-font': string[]
698+
'text-font': string[] ,
699+
'text-color': color
678700
},
679701
680702
]
681703
```
682704

683705
**Example**
684706

685-
The following example formats the text field by adding a bold font and scaling up the font size of the `title` property of the feature. This example also adds the `subtitle` property of the feature on a newline, with a scaled down font size.
707+
The following example formats the text field by adding a bold font and scaling up the font size of the `title` property of the feature. This example also adds the `subtitle` property of the feature on a newline, with a scaled down font size and colored red.
686708

687709
```javascript
688710
var layer = new atlas.layer.SymbolLayer(datasource, null, {
@@ -701,7 +723,10 @@ var layer = new atlas.layer.SymbolLayer(datasource, null, {
701723

702724
//Scale the font size down of the subtitle property.
703725
['get', 'subtitle'],
704-
{ 'font-scale': 0.75 }
726+
{
727+
'font-scale': 0.75,
728+
'text-color': 'red'
729+
}
705730
]
706731
}
707732
});

articles/azure-maps/how-to-manage-authentication.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,4 @@ Learn how to see the API usage metrics for your Azure Maps account:
107107
For a list of samples showing how to integrate Azure Active Directory (AAD) with Azure Maps, see:
108108

109109
> [!div class="nextstepaction"]
110-
> [AAD authentication samples](https://github.com/Azure-Samples/Azure-Maps-AzureAD-Samples)
110+
> [Azure AD authentication samples](https://github.com/Azure-Samples/Azure-Maps-AzureAD-Samples)

articles/azure-maps/how-to-use-map-control.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ You can embed a map in a web page by using the Map Control client-side Javascrip
105105

106106
A list of samples showing how to integrate Azure Active Directory (AAD) with Azure Maps can be found [here](https://github.com/Azure-Samples/Azure-Maps-AzureAD-Samples).
107107

108-
For more information, see the [Authentication with Azure Maps](azure-maps-authentication.md) document.
108+
For more information, see the [Authentication with Azure Maps](azure-maps-authentication.md) document and also the [Azure Maps Azure AD authentication samples](https://github.com/Azure-Samples/Azure-Maps-AzureAD-Samples).
109109

110110
6. Optionally, you may find adding the following meta tag elements to the head of your page helpful:
111111

@@ -229,4 +229,4 @@ To add more data to your map:
229229
For a list of samples showing how to integrate Azure Active Directory (AAD) with Azure Maps, see:
230230

231231
> [!div class="nextstepaction"]
232-
> [AAD authentication samples](https://github.com/Azure-Samples/Azure-Maps-AzureAD-Samples)
232+
> [Azure AD authentication samples](https://github.com/Azure-Samples/Azure-Maps-AzureAD-Samples)

articles/azure-maps/index.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,15 @@ sections:
4545
style: unordered
4646
items:
4747
- html: <a href="/azure/azure-maps/tutorial-geofence">Set up a geofence</a>
48+
- html: <a href="/azure-maps/tutorial-iot-hub-maps">Spatial analytics</a>
49+
- html: <a href=/azure/azure-maps/tutorial-ev-routing">EV routing using Azure Notebooks (Python)</a>
4850
- title: Reference
4951
items:
5052
- type: list
5153
style: cards
5254
className: cardsW
5355
items:
5456
- title: JavaScript
55-
html: <p><a href="https://docs.microsoft.com/javascript/api/azure-maps-javascript/">Map control</a></p>
57+
html: <p><a href="https://docs.microsoft.com/javascript/api/azure-maps-javascript/">Map control</a></p><p><a href="https://docs.microsoft.com/javascript/api/azure-maps-drawing-tools/">Drawing tools module</a></p><p><a href="https://docs.microsoft.com/javascript/api/azure-maps-rest/">Services module</a></p>
5658
- title: REST
5759
html: <p><a href="https://docs.microsoft.com/rest/api/maps/data">Data service</a></p><p><a href="https://docs.microsoft.com/rest/api/maps/geolocation">Geolocation service</a></p><p><a href="https://docs.microsoft.com/rest/api/maps/mobility">Mobility service</a></p><p><a href="https://docs.microsoft.com/rest/api/maps/render">Render service</a></p><p><a href="https://docs.microsoft.com/rest/api/maps/route">Route service</a></p><p><a href="https://docs.microsoft.com/rest/api/maps/search">Search service</a></p><p><a href="https://docs.microsoft.com/rest/api/maps/spatial">Spatial service</a></p><p><a href="https://docs.microsoft.com/rest/api/maps/timezone">Timezone service</a></p><p><a href="https://docs.microsoft.com/rest/api/maps/traffic">Traffic service</a></p>

articles/azure-maps/map-add-heat-map-layer.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ Heat maps, also known as point density maps, are a type of data visualization us
2222
> [!TIP]
2323
> Heat map layers by default will render the coordinates of all geometries in a data source. To limit the layer so that it only renders point geometry features, set the `filter` property of the layer to `['==', ['geometry-type'], 'Point']` or `['any', ['==', ['geometry-type'], 'Point'], ['==', ['geometry-type'], 'MultiPoint']]` if you want to include MultiPoint features as well.
2424
25+
<br/>
26+
27+
<iframe src="https://channel9.msdn.com/Shows/Internet-of-Things-Show/Heat-Maps-and-Image-Overlays-in-Azure-Maps/player" width="960" height="540" allowFullScreen frameBorder="0"></iframe>
28+
2529
## Add a heat map layer
2630

2731
To render a data source of points as a heat map, pass your data source into an instance of the `HeatMapLayer` class and add it to the map as shown here.

articles/azure-maps/map-add-image-layer.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ This article shows you how you can overlay an image to fixed set of coordinates
2424
> [!TIP]
2525
> An [ImageLayer](https://docs.microsoft.com/javascript/api/azure-maps-control/atlas.layer.imagelayer?view=azure-iot-typescript-latest) is a quick an easy way to overlay an image on a map. However, if the image is large, the browser may struggle to load it. In this case, consider breaking your image up into tiles and loading them into the map as a [TileLayer](https://docs.microsoft.com/javascript/api/azure-maps-control/atlas.layer.tilelayer?view=azure-iot-typescript-latest).
2626
27+
The image layer supports the following image formats:
28+
29+
- JPEG
30+
- PNG
31+
- BMP
32+
- GIF (no animations)
33+
2734
## Add an image layer
2835

2936
In the following code overlays an image of a [map of Newark New Jersey from 1922](https://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg) on the map. An [ImageLayer](https://docs.microsoft.com/javascript/api/azure-maps-control/atlas.layer.imagelayer?view=azure-iot-typescript-latest) is created by passing a URL to an image and coordinates for the four corners in the format `[Top Left Corner, Top Right Corner, Bottom Right Corner, Bottom Left Corner]`.

articles/azure-maps/map-add-pin.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ A symbol can be connected up to a data source and used to render an icon and/or
1818
> [!TIP]
1919
> Symbol layers by default will render the coordinates of all geometries in a data source. To limit the layer such that it only renders point geometry features set the `filter` property of the layer to `['==', ['geometry-type'], 'Point']` or `['any', ['==', ['geometry-type'], 'Point'], ['==', ['geometry-type'], 'MultiPoint']]` if you want to include MultiPoint features as well.
2020
21+
The maps image sprite manager, which is used to load custom images used by the symbol layer supports the following image formats:
22+
23+
- JPEG
24+
- PNG
25+
- SVG
26+
- BMP
27+
- GIF (no animations)
28+
2129
## Add a symbol layer
2230

2331
To add a symbol layer to the map and render data, a data source first needs to be created and added the map. A symbol layer can then be created and passed in the data source to retrieve the data from. Finally, data needs to be added into the data source so that there is something to be rendered. The following code shows the code that should be added to the map after it has loaded to render a single point on the map using a symbol layer.

0 commit comments

Comments
 (0)