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/add-custom-protocol-pmtiles.md
+15-13Lines changed: 15 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,27 +3,27 @@ title: Add custom protocol PMTiles in the Web SDK | Microsoft Azure Maps
3
3
description: Learn how to Add custom protocol PMTiles using the Web SDK.
4
4
author: sinnypan
5
5
ms.author: sipa
6
-
ms.date: 10/15/2024
6
+
ms.date: 10/13/2024
7
7
ms.topic: how-to
8
8
ms.service: azure-maps
9
9
ms.subservice: web-sdk
10
10
---
11
11
12
-
# Add custom protocols
12
+
# Add custom protocol PMTiles
13
13
14
-
The Azure Maps Web SDK supports custom protocols such as [PMTiles], a unique archive format designed to efficiently store and deliver tiled data. Eabling this protocol in the Azure Maps Web SDK alows the compression of an entire tile dataset into a single file, improving portability. This protocol is particularly suitable for cloud-based storage solutions.
14
+
The Azure Maps Web SDK supports custom protocols such as [PMTiles]. The `pmtiles://` protocol is used to reference PMTiles archives, which are single-file formats for storing tiled data such as vector and raster maps. This protocol allows Azure Maps to access specific tiles within a PMTiles archive using an HTTP request, fetching only the necessary data on demand.
15
15
16
16
## Add custom protocol
17
17
18
18
By using the `addProtocol` function, which registers a callback triggered before any AJAX request made by the library, you can intercept, modify, and return the request for further processing and rendering. This enables the implementation of a custom callback function to load resources when a URL starts with the designated custom schema.
19
19
20
-
To start, add a reference to the protocol. The following example references the `pmtiles` library:
20
+
The first step is to add a reference to the protocol. The following example references the `pmtiles` library:
@@ -44,19 +44,16 @@ Then, initialize the MapLibre PMTiles protocol.
44
44
45
45
## Add PMTiles Protocol
46
46
47
-
To add the PMTiles protocal, hook the data source with specified protocol url schema. This sample leverages the [Overture] building dataset to enrich building data on top of the basemap.
47
+
To add the PMTiles protocol, hook the data source with the specified protocol URL schema. The following sample uses the [Overture] building dataset to add building data over the basemap.
PMTiles are added as a map source during the map event. Once added, the specified URL schema is supported and recognized by the Azure Maps Web SDK. In the following sample, the PMTiles URL is added as a `VectorTileSource`.
57
-
58
-
> [!NOTE]
59
-
> Using the `pmtiles://` protocol automatically creates a `minzoom` and `maxzoom` property for the source.
56
+
PMTiles are added as a map source during the map event. Once added, the specified URL schema is available to the Azure Maps Web SDK. In the following sample, the PMTiles URL is added as a `VectorTileSource`.
60
57
61
58
```js
62
59
//Add the source to the map.
@@ -68,9 +65,14 @@ PMTiles are added as a map source during the map event. Once added, the specifie
68
65
);
69
66
```
70
67
68
+
> [!NOTE]
69
+
> Using the `pmtiles://` protocol automatically creates the `minzoom` and `maxzoom` properties for the source.
70
+
71
71
## Enrich Map with Overture data
72
72
73
-
Overture had been provided unified, comprehensive [data schema] with different themes. The following sample leverages the building theme's properties (e.g., building type, building height) to demonstrate building extrusion and differentiate building categories on the basemap, rather than just showing building footprints.
73
+
Overture provides a unified and comprehensive [data schema] designed to organize and structure geospatial data effectively. This schema is divided into different themes, each representing a specific type of geospatial information.
74
+
75
+
The following sample uses the building theme's properties (for example, building type and height) to demonstrate building extrusion and differentiate between building categories on the basemap, rather than just showing building footprints.
74
76
75
77
```js
76
78
//Create a polygon extrusion layer.
@@ -116,7 +118,7 @@ Overture had been provided unified, comprehensive [data schema] with different t
116
118
);
117
119
```
118
120
119
-
The following image shows a screenshot displaying the extrusion of buildings by different types near Central Park, New York City.
121
+
The following image shows a screenshot displaying the extrusion of buildings of different types near Central Park in New York City.
0 commit comments