Skip to content

Commit 12d9695

Browse files
authored
Merge pull request #212284 from stevemunk/SM-Creator-Custom-Styling-Preview
Articles for the creator custom styling preview
2 parents 8f3bb11 + f4ba9b1 commit 12d9695

19 files changed

+491
-65
lines changed

articles/azure-maps/creator-indoor-maps.md

Lines changed: 128 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ services: azure-maps
1010

1111
---
1212

13-
1413
# Creator for indoor maps
1514

1615
This article introduces concepts and tools that apply to Azure Maps Creator. We recommend that you read this article before you begin to use the Azure Maps Creator API and SDK.
@@ -51,6 +50,7 @@ Creator services create, store, and use various data types that are defined and
5150
- Converted data
5251
- Dataset
5352
- Tileset
53+
- Custom styles
5454
- Feature stateset
5555

5656
## Upload a Drawing package
@@ -74,6 +74,7 @@ Azure Maps Creator provides the following services that support map creation:
7474
- [Dataset service](/rest/api/maps/v2/dataset).
7575
- [Tileset service](/rest/api/maps/v2/tileset).
7676
Use the Tileset service to create a vector-based representation of a dataset. Applications can use a tileset to present a visual tile-based view of the dataset.
77+
- Custom styles. Use the [style service][style] or [visual style editor][style editor] to customize the visual elements of an indoor map.
7778
- [Feature State service](/rest/api/maps/v2/feature-state). Use the Feature State service to support dynamic map styling. Applications can use dynamic map styling to reflect real-time events on spaces provided by the IoT system.
7879

7980
### Datasets
@@ -95,10 +96,119 @@ After a tileset is created, it can be retrieved by the [Render V2 service](#rend
9596
If a tileset becomes outdated and is no longer useful, you can delete the tileset. For information about how to delete tilesets, see [Data maintenance](#data-maintenance).
9697

9798
>[!NOTE]
98-
>A tileset is independent of the dataset from which it was created. If you create tilesets from a dataset, and then subsequently update that dataset, the tilesets isn't updated.
99+
>A tileset is independent of the dataset from which it was created. If you create tilesets from a dataset, and then subsequently update that dataset, the tilesets isn't updated.
99100
>
100101
>To reflect changes in a dataset, you must create new tilesets. Similarly, if you delete a tileset, the dataset isn't affected.
101102
103+
### Custom styling (Preview)
104+
105+
A style defines the visual appearance of a map. It defines what data to draw, the order to draw it in, and how to style the data when drawing it. Azure Maps Creator styles support the MapLibre standard for [style layers][style layers] and [sprites][sprites].
106+
107+
When you convert a drawing package after uploading it to your Azure Maps account, default styles are applied to the elements of your map. The custom styling service enables you to customize the visual appearance of your map. You can do this by manually editing the style JSON and importing it into your Azure Maps account using the [Style - Create][create-style] HTTP request, however the recommended approach is to use the [visual style editor][style editor]. For more information, see [Create custom styles for indoor maps](how-to-create-custom-styles.md).
108+
109+
Example layer in the style.json file:
110+
111+
```json
112+
{
113+
"id": "indoor_unit_gym_label",
114+
"type": "symbol",
115+
"filter": ["all", ["has","floor0"], ["any", ["==", "categoryName", "room.gym"]]],
116+
"layout": {
117+
"visibility": "none",
118+
"icon-image": "gym",
119+
"icon-size": {"stops": [[17.5, 0.7], [21, 1.1]]},
120+
"symbol-avoid-edges": true,
121+
"symbol-placement": "point",
122+
"text-anchor": "top",
123+
"text-field": "{name}",
124+
"text-font": ["SegoeFrutigerHelveticaMYingHei-Medium"],
125+
"text-keep-upright": true,
126+
"text-letter-spacing": 0.1,
127+
"text-offset": [0, 1.05],
128+
"text-size": {"stops": [[18, 5], [18.5, 6.5], [19, 8], [19.5, 9.5], [20, 11]]}
129+
},
130+
"metadata": {"microsoft.maps:layerGroup": "labels_indoor"},
131+
"minzoom": 17.5,
132+
"paint": {
133+
"text-color": "rgba(0, 0, 0, 1)",
134+
"text-halo-blur": 0.5,
135+
"text-halo-color": "rgba(255, 255, 255, 1)",
136+
"text-halo-width": 1,
137+
"text-opacity": ["step", ["zoom"], 0, 18, 1]
138+
},
139+
"source-layer": "Indoor unit"
140+
},
141+
```
142+
143+
| Layer Properties | Description |
144+
|------------------|-------------------------------------------------------------------|
145+
| id | The name of the layer |
146+
| type | The rendering type for this layer.<br/>Some of the more common types include:<br/>**fill**: A filled polygon with an optional stroked border.<br/>**Line**: A stroked line.<br/>**Symbol**: An icon or a text label.<br/>**fill-extrusion**: An extruded (3D) polygon. |
147+
| filter | Only features that match the filter criteria are displayed. |
148+
| layout | Layout properties for the layer. |
149+
| minzoom | A number between 0 and 24 that represents the minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden. |
150+
| paint | Default paint properties for this layer. |
151+
| source-layer | A source supplies the data, from a vector tile source, displayed on a map. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources.|
152+
153+
#### Map configuration
154+
155+
The map configuration is an array of configurations. Each configuration consists of a [basemap][basemap] and one or more layers, each layer consisting of a [style][style] + [tileset][tileset] tuple.
156+
157+
The map configuration is used when you [Instantiate the Indoor Manager][instantiate-indoor-manager] of a Map object when developing applications in Azure Maps. It's referenced using the `mapConfigurationId` or `alias`. Map configurations are immutable. When making changes to an existing map configuration, a new map configuration will be created, resulting in a different `mapConfingurationId`. Anytime you create a map configuration using an alias already used by an existing map configuration, it will always point to the new map configuration.
158+
159+
Below is an example of a map configuration JSON showing the default configurations. See the table below for a description of each element of the file:
160+
161+
```json
162+
{
163+
"version": 1.0,
164+
"description": "This is the default Azure Maps map configuration for facility ontology tilesets.",
165+
"defaultConfiguration": "indoor_light",
166+
"configurations": [
167+
{
168+
"name": "indoor_light",
169+
"displayName": "Indoor light",
170+
"description": "A base style for Azure Maps.",
171+
"thumbnail": "indoor_2022-01-01.png",
172+
"baseMap": "microsoft_light",
173+
"layers": [
174+
{
175+
"tilesetId": "fa37d225-924e-3f32-8441-6128d9e5519a",
176+
"styleId": "microsoft-maps:indoor_2022-01-01"
177+
}
178+
]
179+
},
180+
{
181+
"name": "indoor_dark",
182+
"displayName": "Indoor dark",
183+
"description": "A base style for Azure Maps.",
184+
"thumbnail": "indoor_dark_2022-01-01.png",
185+
"baseMap": "microsoft_dark",
186+
"layers": [
187+
{
188+
"tilesetId": "fa37d225-924e-3f32-8441-6128d9e5519a",
189+
"styleId": "microsoft-maps:indoor_dark_2022-01-01"
190+
}
191+
]
192+
}
193+
]
194+
}
195+
```
196+
197+
| Style Object Properties | Description |
198+
|-------------------------|--------------------------------|
199+
| Name | The name of the style. |
200+
| displayName | The display name of the style. |
201+
| description | The user defined description of the style. |
202+
| thumbnail | Use to specify the thumbnail used in the style picker for this style. For more information, see the [style picker control][style-picker-control]. |
203+
| baseMap | Use to Set the base map style. |
204+
| layers  | The layers array consists of one or more *tileset + Style* tuples, each being a layer of the map. This enables multiple buildings on a map, each building represented in its own tileset. |
205+
206+
#### Additional information
207+
208+
- For more information how to modify styles using the style editor, see [Create custom styles for indoor maps][style-how-to].
209+
- For more information on style Rest API, see [style][style] in the Maps Creator Rest API reference.
210+
- For more information on the map configuration Rest API, see [Creator - map configuration Rest API][map-config-api].
211+
102212
### Feature statesets
103213

104214
Feature statesets are collections of dynamic properties (*states*) that are assigned to dataset features, such as rooms or equipment. An example of a *state* can be temperature or occupancy. Each *state* is a key/value pair that contains the name of the property, the value, and the timestamp of the last update.
@@ -126,7 +236,7 @@ You can use the [Web Feature Service (WFS) API](/rest/api/maps/v2/wfs) to query
126236

127237
### Alias API
128238

129-
Creator services such as Conversion, Dataset, Tileset, and Feature State return an identifier for each resource that's created from the APIs. The [Alias API](/rest/api/maps/v2/alias) allows you to assign an alias to reference a resource identifier.
239+
Creator services such as Conversion, Dataset, Tileset and Feature State return an identifier for each resource that's created from the APIs. The [Alias API](/rest/api/maps/v2/alias) allows you to assign an alias to reference a resource identifier.
130240

131241
### Indoor Maps module
132242

@@ -161,3 +271,18 @@ The following example shows how to update a dataset, create a new tileset, and d
161271

162272
> [!div class="nextstepaction"]
163273
> [Tutorial: Creating a Creator indoor map](tutorial-creator-indoor-maps.md)
274+
275+
> [!div class="nextstepaction"]
276+
> [Create custom styles for indoor maps](how-to-create-custom-styles.md)
277+
278+
[style layers]: https://docs.mapbox.com/mapbox-gl-js/style-spec/layers/#layout
279+
[sprites]: https://docs.mapbox.com/help/glossary/sprite/
280+
[create-style]: /rest/api/maps/v20220901preview/style/create
281+
[basemap]: supported-map-styles.md
282+
[style]: /rest/api/maps/v20220901preview/style
283+
[tileset]: /rest/api/maps/v20220901preview/tileset
284+
[style-picker-control]: choose-map-style.md#add-the-style-picker-control
285+
[style-how-to]: how-to-create-custom-styles.md
286+
[map-config-api]: /rest/api/maps/v20220901preview/mapconfiguration
287+
[instantiate-indoor-manager]: how-to-use-indoor-module.md#instantiate-the-indoor-manager
288+
[style editor]: https://azure.github.io/Azure-Maps-Style-Editor

0 commit comments

Comments
 (0)