Skip to content

Commit 525e78a

Browse files
committed
articles-about-the-spatial-io-module
1 parent 96e09fe commit 525e78a

File tree

2 files changed

+35
-21
lines changed

2 files changed

+35
-21
lines changed

articles/azure-maps/how-to-use-spatial-io-module.md

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ ms.subservice: web-sdk
1212

1313
# How to use the Azure Maps Spatial IO module
1414

15-
The Azure Maps Web SDK provides the [Spatial IO module], which integrates spatial data with the Azure Maps Web SDK using JavaScript or TypeScript. You can use the robust features in this module to:
15+
The Azure Maps Web SDK provides the [Spatial IO module], which integrates spatial data with the Azure Maps Web SDK using JavaScript or TypeScript. This guide demonstrates how to integrate and use the Spatial IO module in a web application.
1616

17-
- [Read and write spatial data]. You can use file formats including Keyhole Markup Language (KML), Compressed KML (KMZ), GPS Exchange Format (GPX), Geographic RSS (GeoRSS), Geography Markup Language (GML), Geographic JavaScript Object Notation (GeoJSON), and Comma-Separated Values (CSV) files containing columns with spatial information. Well-Known Text (WKT) is also supported.
17+
You can use the robust features in this module to:
18+
19+
- [Read and write spatial data].
1820
- Connect to Open Geospatial Consortium (OGC) services and integrate with Azure Maps Web SDK. You can also overlay Web Map Services (WMS) and Web Map Tile Services (WMTS) as layers on the map. For more information, see [Add a map layer from the Open Geospatial Consortium (OGC)].
1921
- Query data in a Web Feature Service (WFS). For more information, see [Connect to a WFS service].
2022
- Overlay complex data sets that contain style information, which can render automatically. For more information, see [Add a simple data layer].
2123
- Use high-speed XML and delimited file reader and writer classes. For more information, see [Core IO operations].
2224

23-
This guide demonstrates how to integrate and use the Spatial IO module in a web application.
24-
2525
The following video provides an overview of the Spatial IO module in the Azure Maps Web SDK.
2626

2727
</br>
@@ -30,6 +30,18 @@ The following video provides an overview of the Spatial IO module in the Azure M
3030
> [!WARNING]
3131
> Only use data and services that are from a source you trust, especially if the data is referenced from another domain. The spatial IO module takes steps to minimize risk, but you should not allow any dangerous data into your application regardless.
3232
33+
## Supported file formats and pre-requisites
34+
35+
You can use file formats that include:
36+
- Keyhole Markup Language (KML).
37+
- Compressed KML (KMZ).
38+
- GPS Exchange Format (GPX).
39+
- Geographic RSS (GeoRSS).
40+
- Geography Markup Language (GML).
41+
- Geographic JavaScript Object Notation (GeoJSON).
42+
- Well-Known Text (WKT).
43+
- Comma-Separated Values (CSV) files containing columns that include spatial information.
44+
3345
Prerequisites include:
3446

3547
- An [Azure Maps account]
@@ -45,13 +57,13 @@ You can load the Azure Maps Spatial IO module using one of the following two opt
4557
<script src="https://atlas.microsoft.com/sdk/javascript/spatial/0/atlas-spatial.js"></script>
4658
```
4759

48-
- With the second option, you can load the source code for [azure-maps-spatial-io] locally, and then host it with your app. This package also includes TypeScript definitions. Use the following command to install the package:
60+
- With the second option, you can load the source code for [azure-maps-spatial-io] locally, and host it with your app. This package also includes TypeScript definitions. Use the following command to install the package:
4961

5062
```sh
5163
npm install azure-maps-spatial-io
5264
```
5365

54-
Then, use an import declaration to add the module into a source file:
66+
Use an import declaration to add the module into a source file:
5567

5668
```js
5769
import * as spatial from "azure-maps-spatial-io";
@@ -74,7 +86,7 @@ You can load the Azure Maps Spatial IO module using one of the following two opt
7486

7587
<meta charset="utf-8">
7688

77-
<!-- Ensures that Internet Explorer and Edge use the latest version and don't emulate an older version -->
89+
<!-- Ensures that Internet Explorer and Edge use the latest version and don't emulate an older version. -->
7890
<meta http-equiv="x-ua-compatible" content="IE=Edge">
7991

8092
<!-- Ensures the web page looks good on all screen sizes. -->
@@ -93,7 +105,7 @@ You can load the Azure Maps Spatial IO module using one of the following two opt
93105
map = new atlas.Map('myMap', {
94106
view: 'Auto',
95107
96-
//Add your Azure Maps subscription key to the map SDK. Get an Azure Maps key at https://azure.com/maps
108+
//Add your Azure Maps subscription key to the map SDK. Get an Azure Maps key at https://azure.com/maps.
97109
authOptions: {
98110
authType: 'subscriptionKey',
99111
subscriptionKey: '<Your Azure Maps Key>'
@@ -155,7 +167,7 @@ You can load the Azure Maps Spatial IO module using one of the following two opt
155167

156168
<meta charset="utf-8">
157169

158-
<!-- Ensures that Internet Explorer and Edge use the latest version and don't emulate an older version -->
170+
<!-- Ensures that Internet Explorer and Edge use the latest version and don't emulate an older version. -->
159171
<meta http-equiv="x-ua-compatible" content="IE=Edge">
160172

161173
<!-- Ensures the web page looks good on all screen sizes. -->

articles/azure-maps/spatial-io-add-simple-data-layer.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ ms.subservice: web-sdk
1515

1616
The spatial IO module provides a `SimpleDataLayer` class. This class makes it easy to render styled features on a map. It can even render data sets that have style properties and data sets that contain mixed geometry types.
1717

18-
The simple data layer achieves this functionality by wrapping multiple rendering layers and by using style expressions. The style expressions search wrapped layers for common style properties. The `atlas.io.read` and `atlas.io.write` functions use these properties to read and write styles into a supported file format. After the properties are added to a supported file format, the file can be used for purposes like displaying styled features on a map.
18+
The simple data layer achieves this functionality by wrapping multiple rendering layers and by using style expressions. The style expressions search wrapped layers for common style properties. The `atlas.io.read` and `atlas.io.write` functions use these properties to read and write styles into a supported file format. When properties are added to a supported file format, the file can be used for purposes like displaying styled features on a map.
1919

2020
The `SimpleDataLayer` class also provides a built-in popup feature with a popup template (which can be disabled if not needed). The popup appears when a feature is selected. This layer also supports clustered data. When a cluster is selected, the map zooms in to the cluster and expands it into individual points and subclusters.
2121

22-
The `SimpleDataLayer` class is intended to be used on large data sets that contain features that have many applied geometry types and styles. When used, this class adds an overhead of six layers containing style expressions. So, there are cases when it's more efficient to use a core rendering layer. For example, you can use a core layer when you only need to render a few geometry types and styles on a feature.
22+
The `SimpleDataLayer` class is intended to be used on large data sets that contain features that have many applied geometry types and styles. When used, this class adds an overhead of six layers containing style expressions. Therefore, if you only need to render a few geometry types and styles on a feature, it might be more efficient to use a core rendering layer.
2323

2424
## Use a simple data layer
2525

@@ -47,7 +47,7 @@ The following code snippet demonstrates how to use a simple data layer that refe
4747
zoom: 12,
4848
view: "Auto",
4949

50-
//Add authentication details for connecting to Azure Maps.
50+
//Add authentication details to connect to Azure Maps.
5151
authOptions: {
5252
// Get an Azure Maps key at https://azuremaps.com/.
5353
authType: "subscriptionKey",
@@ -102,18 +102,18 @@ The following code snippet demonstrates how to use a simple data layer that refe
102102
</script>
103103
```
104104

105-
When you add features to the data source, the simple data layer renders them in the most appropriate way. You can set styles for individual features as properties on the feature.
105+
When you add features to the data source, the simple data layer renders them in the most appropriate way. You can set styles as properties for each individual feature.
106106

107-
The preceding sample code shows a GeoJSON point feature with a `color` property set to `red`.
107+
The preceding sample code shows a Geographic JavaScript Object Notation (GeoJSON) point feature with a `color` property set to `red`.
108108

109-
The sample code renders the point feature using the simple data layer, and appears as follows.
109+
The sample code renders the point feature by using the simple data layer, and the result appears as follows.
110110

111111
:::image type="content" source="./media/spatial-io-add-simple-data-layer/simple-data-layer.png"alt-text="A screenshot of a map with coordinates of 0, 0 that shows a red dot over blue water; the red dot was added using the symbol layer.":::
112112

113113
> [!NOTE]
114114
> The value from the data source `"coordinates": [0, 0]` overrides the coordinates `center: [-73.967605, 40.780452]` that you set when the map was initialized.
115115
116-
The simple data layer is a powerful tool for the following scenarios:
116+
The simple data layer can be used as a powerful tool in the following scenarios:
117117

118118
- A data source includes several feature types.
119119
- Features in the data set have several style properties that are individually set.
@@ -128,22 +128,24 @@ For example, when parsing XML data feeds, you might not know the features' exact
128128
------------------------------------>
129129

130130
> [!NOTE]
131-
> This simple data layer uses the [popup template] class to display KML balloons or feature properties as a table. By default, all content rendered in the popup is sandboxed inside of an iFrame as a security feature. However, there are limitations:
131+
> This simple data layer uses the [popup template] class to display KML balloons or feature properties as a table. By default, all content rendered in the popup is sandboxed inside an iFrame as a security feature. However, there are limitations:
132132
>
133-
> - All scripts, forms, pointer lock, and top navigation functionalities are disabled. Links can open in a new tab when selected.
133+
> - All pointer lock functionality, top navigation functionality, scripts, and forms are disabled. Links can open in a new tab when selected.
134134
> - Older browsers that don't support the `srcdoc` parameter on iFrames can only render a small amount of content.
135135
>
136-
> If you trust the data loaded into the pop-ups, and want popup scripts to be able to access your application, you can disable this feature. Just set the popup templates `sandboxContent` option to false.
136+
> If you trust the data loaded into the pop-ups, and want popup scripts to be able to access your application, you can disable this feature. Just set the `sandboxContent` option in the popup template to false.
137137
138138
## Default supported style properties
139139

140140
The simple data layer wraps several of the core rendering layers: bubble, symbol, line, polygon, and extruded polygon. It uses expressions to search for valid style properties on individual features.
141141

142-
The two main sets of supported property names are Azure Maps and GitHub. Most property names of Azure Maps layer options are supported in the simple data layer as style properties of features. Some layer options include expressions that support style property names that are commonly used by GitHub. [GitHub's GeoJSON map support] defines these property names, and they're used to style GeoJSON files that are stored and rendered within the platform. Most of GitHub's styling properties are supported in the simple data layer, except the `marker-symbol` styling properties.
142+
The two main sets of supported property names are Azure Maps and GitHub. Most property names of Azure Maps layer options are supported in the simple data layer as style properties of features. Some layer options include expressions that support style property names that are commonly used by GitHub.
143+
144+
[GitHub's GeoJSON map support] defines these property names, which are used to style GeoJSON files that are stored and rendered within the platform. Most of GitHub's styling properties are supported in the simple data layer, except the `marker-symbol` styling properties.
143145

144146
If the reader comes across a less common style property, it converts it to the most similar Azure Maps style property. Additionally, you can override the default style expressions by using the `getLayers` function of the simple data layer and updating the options on any of the layers.
145147

146-
The following sections provide details on the default style properties that the simple data layer supports. The order of the supported property name is also the priority of the property. If two style properties are defined for the same layer option, the first one in the list has higher precedence. Any CSS3 color value including HEX, RGB, RGBA, HSL, HSLA, or named color value can be used.
148+
The following sections provide details on the default style properties that the simple data layer supports. The order of the supported property names is also the priority. If two style properties are defined for the same layer option, the first one in the list takes precedence. Any CSS3 color value including HEX, RGB, RGBA, HSL, HSLA, or named color value can be used.
147149

148150
### Bubble layer style properties
149151

0 commit comments

Comments
 (0)