Vector Tiles and Styles

2890
8
09-27-2017 03:23 PM
NathanMellor
Occasional Contributor

I think one of the values of the Vector tiles is that you can customize the style without changing the tiles, right? 

But how do I actually do that? In particular, offline?

Looking at the documentation for ArcGISVectorTiledLayer, you seemed to have locked all that out. 

There is no method called setStyle(String pathtolocalfile). I knew it wouldn't be that easy. 

I found this in the API documentation. It needs a mind mapping diagram, but I believe that you are able to specify a style sheet in a portal based map. So I guess I could do that if I create my own vector tile server on ArcGIS online. But I couldn't specify a different style sheet for one of your standard vector basemaps, or could I?

I made a table just to try to understand it, and I see at least one circular reference. 

This also states that a vector tile package should contain a style sheet and all the font and symbols needed to display the map. 

So let's see. Let's say I created a 5 Gigabyte vector tile package of a country. If I wanted to change the style, I would need to create another 5 Gigabyte vector tile package of the same country, exactly the same except with a different style sheet. Is that right?

 

I'll note that I don't see any offline vector tile layer examples, nor any sample .vtpk file.  I think that's needed. 

To create a vector tiled layer, the runtime client is given either a URI or a portal item. The URI can point to a vector tile source, a vector tile style sheet, or a local vector tile package file. The portal item will contain a URI to a vector tile stylesheet. The style sheet describes the appearance of the geometry and must be in the Mapbox GL Style format. The style sheet also contains a URI to a vector tile source. The source must be in the Mapbox TileJSON format. The source info includes a URI to a default style sheet.

More than one vector tile style sheet can use the same source. Both the source info and the style sheet are human readable JSON files.

Vector tile packages can also be downloaded from an ArcGIS Online vector tile service. The vector tile package is a single file (.vptk) that contains all of the tile data files, the source information, a style sheet, and the font and symbol marker resources required to display the map.

ParameterPoints toContainspoints toHeader 5
URIvector tile sourceMapBoxTileJSON Format
URLdefault style sheet
vector tile stylesheetMapbox GL Style Format
URIvector tile source
local vector tile packageAll the tile data files
Source information
vector tile stylesheet
font and symbols. 
PortalURIvector tile stylesheet
0 Kudos
8 Replies
NathanMellor
Occasional Contributor

I will note that this article. 

Create Vector Tile Package—Data Management toolbox | ArcGIS Desktop 

Does not mention a thing about stylesheets nor show anywhere to choose or edit them. 

So perhaps even having multiple .vtpk won't work. 

0 Kudos
dotMorten_esri
Esri Frequent Contributor

At this point a VTPK can have one and only one style associated with it. It's not possible to just swap out the style  and reuse the same data. So you would have to create multiple VTPK files with the same data but different styles packages inside them.

This is of course something we'd like to add support for in the future.

0 Kudos
NathanMellor
Occasional Contributor

I certainly hope that is soon, because it defeats the purpose of stylesheets. Duplicate 5gig of data to change a 5k stylesheet is cumbersome. Offline maps are the ones that benefit the most from flexible styles. 

But as for the other question, how do the stylesheets get into the VTPK? Where does one make those style choices?

I don't see anything in those instructions that say to edit or create a stylesheet in the process of exporting a VTPK. 

0 Kudos
AnttiKajanus1
Regular Contributor II

As Morten mentioned, at the moment you can only use one style per vtpk since the styles are baked into the .vtpks directly. We are currently working to support for exporting .vtpk-files from the exportTiles enabled hosted Vector Tile Services with custom styles that are exposed through ArcGIS Portal (as a Vector Tile Layer). When this functionality is released, you can publish a single vector tile service and then point multiple Vector Tile Layers to it that exposes the custom parts and then you can export one or more .vtpk files with a default style (packaged to the vtpk file) and n*custom styles for it.

Meanwhile, here are some resources that should give you better understanding how to work with the Vector Tiles

0 Kudos
NathanMellor
Occasional Contributor

This is a lot of the information I need. From that, it looks like I can at least experiment with custom styles with my ArcGIS Online account. 

It appears that if you are extra careful to only use simple styles when authoring the map, what it looks like on the screen in ArcGIS desktop will be recorded as the stylesheet. 

Just some clarifications. 

When the future functionality is released, you will be able to have n*custom styles located outside the vtpk file, or all baked in? I assume it will need a new version of the Runtime. 

At present, can ArcGIS Desktop tools (Basic) create .vtpk files from Vector Tile Services on the ArcGIS portal?

0 Kudos
AnttiKajanus1
Regular Contributor II

As the documentation indicates, as long as you avoid the non-supported symbols and effects it should be good.

We are targeting to support exporting vector tile packages and resources (custom styles) in next ArcGIS Runtime release. The Update 2 release should be out in December with the typical small print that this is subject to change etc.  For offline use, you can export a .vtpk file (vector tile cache) that contains the tiles and the default style (which is stored in the service) and then you can export item resource cache (style information that is stored in the portal item = read : custom styles). This can be done separately so the extra styles are not baked into the .vtpk file (but the default style is) 

ExportVector Tiles operation is not currently available on ArcGIS Portal that Desktop tools can use. If you use ArcGIS Portal hosted vector tile service, you can only use them as an online layers.

0 Kudos
NathanMellor
Occasional Contributor

I hope these things make it into 100.2. 

0 Kudos
AnttiKajanus1
Regular Contributor II

Support for exporting vtpks and style item resources is going to available on 100.2 release. You can use `ExportVectorTilesTask` to work directly with vector tile layers exposed as portal items  (access to tiles and custom style resources) or working directly with the service endpoints for tiles (but you don't have access to the custom styles this way). Offline you can use one tile cache and create new layers from it using different styles.