Vector tiles
I am looking at what it will take to set up a stack to use vector tiles.
About Mapbox vector tiles
The obvious approach
After it was already picking up speed, ESRI jumped in and added tile support. I have no idea (yet) if there is any compatibility.
- ESRI ArcGis Pro - generate tiles
- ESRI ArcGis Enterprise - serve tiles
- ESRI ArcGIS API for Javascript - browser support
In this blog post ESRI says they based their API on mapbox-gl.js. Amusingly ESRI doesn't seem to index this page, if you search for mapbox, only some unrelated article comes up.
The ESRI basemaps seem to be all raster based only at this time, though I have this link: http://basemapsbeta.arcgis.com/preview/app/index.html
Publish Vector Tiles to Portal
https://enterprise.arcgis.com/en/portal/latest/use/publish-vector-tiles.htm
- Install ArcGIS Pro
- Create a map
- Add your standard data, taxlots in my case.
- Reproject your data into Web Mercator
- Create Vector Tile Package
- Create an vector index
- Create a vector tile package
- Use "Add Data" in AGP to preview at the results.
- Publish
I create the vector index and vector tile package using a Python script, see c:/Users/bwilson/source/repos/WebMaps/VectorTiles-Taxlots-Project/
About the tile package
https://pro.arcgis.com/en/pro-app/help/sharing/overview/vector-tile-package.htm
The generated file is a ZIP archive with a vtpk extension. It contains
- tilemap/root.json Styles are here.
- An esriinfo folder containing item.pkinfo, iteminfo.xml, and thumbnail/thumbnail.png
- about a hundred PBF files = "protocol buffer" that look like font data ("Tahoma Regular")?!?
- tile/??/*.bundle files, about 2 dozen.
- a medley of other supporting files; looks like there are sprites. They use sprites for things like textures.
Learn how to tweak styles, fonts, picture markers: https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/working-with-fonts-and-sprites-being-creative-with-esri-vector-tiles/
This is what the "share as" dialog should look like, note especially "Copy all data" checkbox.
The open source option
A lot is happening in this space. Instead of putting many links here, just look at this firehose of open source vector tile resources: https://github.com/mapbox/awesome-vector-tiles
My choices
I have to start somewhere.
Browser client: I want to try mapbox-gl but since I already have familiarity with Openlayers, I will try it first.
Tile sources:
- I put a taxlot layer up on ArcGIS Online
- There are ESRI basemaps in vector format
- I will also try Mapbox since I already set up an account there.
That's all I need to set up a test! I have added it to Map46 in Github in vectortiles/ folder.
Vector base maps
These are generally free services at the levels I will be using them.
- https://www.maptiler.com/cloud (Klokan also openmaptiles.com and openmaptiles.org) How to
- http://mapbox.com
- https://www.mapcat.com/
- https://thunderforest.com/
OpenMapTiles
I can download some tiles for free then serve them on Bellman by also grabbing their Docker. I will be trying this out tonight when I am on map46 time.
It said "free downloads" but when I asked for a custom extent to limit download size it said $10. I asked for data in this extent -124.18945,45.62172,-123.11279,46.42271 Zoom 10 to 14 (14 is as good as it gets)
I changed my request to "Oregon" and "evaluation and education" and we're good.