Vector tiles can be hosted locally or in the cloud. This tutorial shows how to configure Internet Information Services (IIS) and use it to host vector tiles.
Prerequisites
To complete the following steps, you will need:
- A running Spark session configured with ArcGIS GeoAnalytics Engine.
- A notebook connected to your Spark session (e.g. Jupyter, JupyterLab, Databricks, EMR, etc.).
- A Windows machine with IIS.
Steps
Configure IIS
You will need to create a website on IIS and provide the path to the vector tile result as the physical path. Some settings need to be configured on IIS first.
-
Add pbf file types in the MIME types.
-
Click on the Default Web Site on IIS.
-
On the properties on the right, open MIME types.
-
Add a new action as: File name extension: .pbf / MIME type: application/x-protobuf
-
-
Enable CORS.
-
Click on the web site you created.
-
On the properties, open HTTP Response Headers.
-
Add a new action as: Name: Access-Control-Allow-Origin / Value: *
-
Update the vector-tile.json
file to use the hosted location
-
The
vector-tile.json
file has a tiles property which is empty. Update it to point to the folder where the .pbf files are hosted.Here is how the tiles property in the json file looks after it is generated by GeoAnalytics Engine:
"tiles" : ["{z}/{y}/{x}.pbf" ]
Change it something like the following:
"tiles" : [ "http
:// <server >/vector _tiles/earthquakes/{z}/{y}/{x}.pbf" ] Where
<server
is your IIS web server in this case and> vector
is the website that points to the physical location where the vector tiles are written._tiles
You should now be able to view the vector tile result in client applications with access to your web server. The steps outlined in the Vector tiles core topic explain how to add hosted vector tiles to a map in ArcGIS Pro or a MapBox web app.