You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-maps/clustering-point-data-web-sdk.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,10 @@ ms.custom: codepen
15
15
16
16
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.
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.
Copy file name to clipboardExpand all lines: articles/azure-maps/data-driven-style-expressions-web-sdk.md
+30-5Lines changed: 30 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -370,13 +370,32 @@ var layer = new atlas.layer.SymbolLayer(datasource, null, {
370
370
});
371
371
```
372
372
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 =newatlas.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
+
373
391
## Type expressions
374
392
375
393
Type expressions provide tools for testing and converting different data types like strings, numbers, and boolean values.
376
394
377
395
| Expression | Return type | Description |
378
396
|------------|-------------|-------------|
379
397
|`['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. |
380
399
|`['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`. |
381
400
|`['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. |
382
401
|`['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
395
414
>//Get the entityType value.
396
415
> ['get', 'entityType'],
397
416
>
398
-
>//If there is no title, try getting the subtitle.
417
+
>//If the entity type is 'restaurant', return a different pixel offset.
399
418
>'restaurant', ['literal', [0, -10]],
400
419
>
401
420
>//Default to value.
@@ -660,6 +679,7 @@ The text field format expression can be used with the `textField` option of the
660
679
661
680
*`'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.
662
681
*`'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.
663
683
664
684
The following pseudocode defines the structure of the text field format expression.
665
685
@@ -669,20 +689,22 @@ The following pseudocode defines the structure of the text field format expressi
669
689
input1: string,
670
690
options1: {
671
691
'font-scale': number,
672
-
'text-font': string[]
692
+
'text-font': string[],
693
+
'text-color': color
673
694
},
674
695
input2: string,
675
696
options2: {
676
697
'font-scale': number,
677
-
'text-font': string[]
698
+
'text-font': string[] ,
699
+
'text-color': color
678
700
},
679
701
…
680
702
]
681
703
```
682
704
683
705
**Example**
684
706
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.
686
708
687
709
```javascript
688
710
var layer =newatlas.layer.SymbolLayer(datasource, null, {
@@ -701,7 +723,10 @@ var layer = new atlas.layer.SymbolLayer(datasource, null, {
701
723
702
724
//Scale the font size down of the subtitle property.
Copy file name to clipboardExpand all lines: articles/azure-maps/how-to-use-map-control.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -105,7 +105,7 @@ You can embed a map in a web page by using the Map Control client-side Javascrip
105
105
106
106
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).
107
107
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).
109
109
110
110
6. Optionally, you may find adding the following meta tag elements to the head of your page helpful:
111
111
@@ -229,4 +229,4 @@ To add more data to your map:
229
229
For a list of samples showing how to integrate Azure Active Directory (AAD) with Azure Maps, see:
Copy file name to clipboardExpand all lines: articles/azure-maps/map-add-heat-map-layer.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,10 @@ Heat maps, also known as point density maps, are a type of data visualization us
22
22
> [!TIP]
23
23
> 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.
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.
Copy file name to clipboardExpand all lines: articles/azure-maps/map-add-image-layer.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,13 @@ This article shows you how you can overlay an image to fixed set of coordinates
24
24
> [!TIP]
25
25
> 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).
26
26
27
+
The image layer supports the following image formats:
28
+
29
+
- JPEG
30
+
- PNG
31
+
- BMP
32
+
- GIF (no animations)
33
+
27
34
## Add an image layer
28
35
29
36
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]`.
Copy file name to clipboardExpand all lines: articles/azure-maps/map-add-pin.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,14 @@ A symbol can be connected up to a data source and used to render an icon and/or
18
18
> [!TIP]
19
19
> 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.
20
20
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
+
21
29
## Add a symbol layer
22
30
23
31
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