Create a vector tile package

First, you'll make sure you have all the needed software to complete the lesson. Then, you'll create a vector tile package containing earthquake data. After that, you'll add the earthquake data to a map in ArcGIS Pro and prepare the map for vector tile creation. Finally, you'll create the vector tile package.

Install required software

During this lesson, you'll complete steps outside of ArcGIS Pro using the free software 7-Zip and Notepad++. You'll also use the JSTool plug-in for Notepad++. 7-Zip is a tool for archiving files. Notepad++ is simple text editor, while the JSTool plug-in formats JSON code in a way that is easier to read and edit.

  1. If necessary, download and install the latest version of 7-Zip version.
  2. If necessary, download and install the latest version of Notepad++ 32-bit or 64-bit.
  3. Open Notepad++.
    Note:

    If you are prompted to download an update package, choose not to.

  4. On the ribbon, click Plugins and choose Plugins Admin.

    The Plugin Admin window opens.

  5. Search for JSTool and check the box. Click Install.
    Note:

    If you are prompted to update the Plugin Admin, choose not to.

    After the plugin is installed, Notepad++ will restart.

Add earthquakes to a map

The United States Geological Survey (USGS) provides earthquake data for download in a variety of formats. You'll download a comma-separated value (CSV) table of every earthquake that occurred in 2017 with a magnitude of 2.5 or above. This CSV file was created based on USGS data. You'll then add the CSV file to ArcGIS Pro as a feature layer.

  1. Download the earthquakes-2017.zip file.
  2. Locate the downloaded file on your computer. Right-click the file and extract it to a location where you can easily find it, such as your Documents folder.
  3. Start ArcGIS Pro. If prompted, sign in using your licensed ArcGIS account.
    Note:

    If you don't have ArcGIS Pro or an ArcGIS account, you can sign up for an ArcGIS free trial.

  4. Under New, click Map.
  5. In the Create a New Project window, for Name, type Earthquakes of 2017. Specify a location to save the project, then click OK.

    The project is created and opens displaying a new map.

  6. On the ribbon, click the Analysis tab. In the Geoprocessing group, click Tools.

    The Geoprocessing pane opens.

  7. In the search box, type XY Table to Point and press Enter.
  8. In the list of results, click XY Table to Point.

    The tool's parameters open.

  9. For Input Table, click the Browse button. Browse to and choose earthquakes_2017.csv.
  10. For Output Feature Class, change the output name to earthquakes_2017. Leave the other parameters unchanged and click Run.

    A new point layer named earthquakes_2017 is added to the map. It shows the locations of earthquakes in 2017. The default symbology is random and may look different than the example images.

    Default point symbols]

Add metadata

Before you create a vector tile package from the data, you'll provide basic metadata about the map.

  1. In the Contents pane, right click Map and choose Properties.
  2. In the Map Properties window, click Metadata.
  3. In Metadata, change the following parameters:
    • For Title, type Earthquakes_of_2017.
    • For Tags, type earthquakes and vector tiles.
    • For Summary, type Earthquakes that occurred in 2017.
    • For Description, type This map shows all earthquakes in 2017 with a magnitude of 2.5 or higher.

    Completed metadata

  4. Click OK.

    The map's metadata is now properly configured.

Set the projection

Next, you'll change the map's projection to WGS 1984 Web Mercator Auxiliary Sphere, the default projection system used by ArcGIS Online. Because you intend to publish your layer, using this projection system is important.

  1. In the Contents pane, right-click Map and choose Properties.
  2. In the Map Properties window, click Coordinate Systems.
  3. In the search box, type Web Mercator and press Enter.
  4. In the search results, expand Projected coordinate system and World. Choose WGC 1984 Web Mercator (auxiliary sphere).
  5. Click OK.

    The map changes to the Web Mercator projection.

Highlight a field

To keep file size small, vector tile packages are saved by default without any feature attributes. In this case, however, you want the earthquake magnitude value to be included for each occurrence. You'll ensure the attribute field is saved with the data by highlighting it.

  1. In the Contents pane, select earthquakes_2017.

    Selecting a layer in the Contents pane displays Feature Layer tabs in the ribbon.

  2. On the ribbon, click the Data tab. In the Design group, click Fields.

    The Fields view opens for the selected layer. While the data contains several fields, you only want to include earthquake magnitude.

  3. For the mag field, check the box in the Highlight column.

    Highlight fields in the Fields view

    Highlighting the mag field will ensure it remains in the output vector tile package you create.

  4. On the ribbon, in the Changes group, click Save.
  5. Close the Fields view.

Create a vector tile package

Next, you'll run the Create Vector Tile Package tool to save a vector tile package of your earthquake map to a location on your computer.

  1. In the Contents pane, uncheck all layers except earthquakes_2017.
  2. In the Geoprocessing pane search box, type Create Vector Tile Package and press Enter.
  3. In the search results, click Create Vector Tile Package.
  4. For Input Map, choose Map. For the Output File name, type earthquakes_2017.
  5. Click Run.

    A vector tile package (.vtpk) is created in your default project folder.

  6. In the Contents pane, uncheck earthquakes_2017 to turn it off.
  7. On the ribbon, click the Map tab. In the Layer group, click Add Data.
  8. Browse to your default project folder, choose earthquakes_2017.vtpk, and click OK.

    The earthquakes_2017.vtpk file is added as a new layer to your map. The layer is identical to the earthquake points layer you used to create the vector tiles.

  9. On the Quick Access Toolbar, click the Save button.
  10. Close ArcGIS Pro.

You've created a vector tile package from a map displaying earthquakes that occurred in 2017. For now, the points in the vector tiles are symbolized using the same default symbols assigned to the layer in the map. Next, you'll edit the vector tile style.


Edit the vector tile style

Previously, you created a vector tile package with earthquake points using the default point symbology. Next, you'll access and edit the style information stored in the vector tile package to change the appearance of your earthquake point symbols.

View and format the style

A vector tile package contains a collection of resource files that are maintained with the vector tiles. Some of these resource files contain font and style information. The appearance of the earthquake point symbols displayed by your vector tiles is managed by instructions saved in a JavaScript Object Notation (JSON) text file embedded in the vector tile package. First, you'll extract the vector tile package so you can access the JSON file. Then, you'll format the file using the JSTool plug-in in Notepad++ to make it more readable.

  1. Browse to the default project folder where earthquakes_2017.vtpk is located.
  2. Right-click earthquakes_2017.vtpk, point to 7-Zip, and choose Extract files.

    You'll use the default settings to extract the contents of your vector tile package.

  3. Click OK.

    Two new folders, p12 and esriinfo, are extracted.

  4. Open the folders p12 > resources > styles.
  5. Right-click root.json and choose Edit with Notepad++.

    The text document opens in Notepad++. It contains a single line of text representing the vector tile package style properties.

    Unformatted JSON

    Programs that can read JSON files, such as ArcGIS Pro, can usually read a JSON file regardless of how it's formatted, as long as characters are in the right order and have the correct punctuation. Humans, however, have a more difficult time reading JSON files. Formatting the text with spacing and line breaks makes it easier to read and interpret. You'll format the JSON file with the JSTool plug-in.

  6. On the ribbon, click Plugins, point to JSTool, and choose JSFormat (Shortcut: Ctrl+Alt+M).

    The JSON file is formatted.

    Formatted JSON content

    The formatted JSON file is organized into multiple lines, most of which start with tabs. The tabs improve the JSON file's readability, but they aren't necessary components of the code. The second line starts with a single tab, followed by the text "version": 8 and a comma.

    Property and value pairs in JSON

    JSON is written as property and value pairs divided by colons. In this case, the property "version" has a value of 8. Properties must always be in quotation marks. Commas separate different property and value pairs from one another. Multiple property and value pairs can be grouped together with braces, such as in the sixth line.

    JSON objects

    When multiple property and value pairs are grouped with braces, they're called an object. Objects can also contain multiple objects of their own. The esri object in the sixth line is inside of an object called sources in the fifth line.

    Nested JSON objects

    A single property can also have multiple values. Values grouped by brackets are called an array. The layers property in the eleventh line contains an array.

    JSON object containing map layers

    This array is a little complicated because it contains multiple objects. In this case, the layers property contains multiple values, which take the form of objects each with their own properties. Each object is a layer. Currently, the JSON file only has one layer: earthquakes_2017, the layer of earthquake points.

    The properties of the earthquakes_2017 layer include information about the layer's style. The type of symbol used to display the points in your earthquakes layer is determined by the type property.

    Symbol type layer

    Currently, the value for type is symbol. The symbol value uses a default icon stored in the vector tile package to display the point.

Edit the style

The default symbol icon does not support more advanced visual effects, such as blur effects that are useful for displaying large amounts of point data. You'll change type to circle, which does support these effects. Then, you'll change the color and effects for the style.

  1. In line 13, replace "symbol" with "circle".

    Circle type layer

    Next, you'll remove some style properties that don't apply to circles. The layout and paint properties contain the rest of the information about how the symbols will look.

    Layout and paint properties

  2. Delete the text in the lines that contain the icon-image, icon-allow-overlap, and icon-color properties.

    Empty layout and paint properties

    Next, you'll add a circle-color property to the paint property to change the color of the circles to blue. Colors are specified using hexadecimal (hex) codes.

    The following table lists the hex codes you'll use to create a glowing point effect for earthquake points. The table also includes equivalent red, green, and blue (RGB) and cyan, magenta, yellow, and black (CMYK) values for comparison.

    Hex codeColorRGB percentCMYK

    #00C8D6

    Blue color

    0 percent red, 78.4 percent green, 83.9 percent blue

    100 percent cyan, 6.5 percent magenta, 0 percent yellow, 16.1 percent black

    #D1FF73

    Green color

    82 percent red, 100 percent green, 45.1 percent blue

    18 percent cyan, 0 percent magenta, 54.9 percent yellow, 0 percent black

    #FFFFBE

    Yellow color

    100 percent red, 100 percent green, 74.5 percent blue

    0 percent cyan, 0 percent magenta, 25.5 percent yellow, 0 percent black

    #FFFFFF

    White color

    100 percent red, 100 percent green, 100 percent blue

    0 percent cyan, 0 percent magenta, 0 percent yellow, 0 percent black

  3. On a new line inside the paint property object, type "circle-color": "#00C8D6".

    Circle color set to a blue hex color

  4. Save the JSON file and close Notepad++.

Repackage the vector tiles

Now that you've updated the style, you'll repackage the vector tiles and open them in ArcGIS Pro to verify that your updates have been applied. When repackaging the tiles, it's important not to compress the data, as is typically done when a .zip file is created. If the data in the JSON file is compressed, ArcGIS Pro won't be able display it on a map. To avoid compressing the data, you'll use the 7-Zip option to create archived data without compression.

  1. Browse to the project folder, Earthquakes of 2017. Select both the esriinfo and p12 folders by pressing Ctrl while clicking them.
    Tip:

    You can also select the folders by drawing a box around them.

  2. Right-click the selected folders, point to 7-Zip, and click Add to archive.

    The Add to Archive window opens.

  3. In the box next to Archive, type earthquakes_2017_blue_circles.vtpk.
  4. For Archive format, choose zip. For Compression level, choose Store.
  5. Click OK.

    The earthquakes_2017_blue_circles.vtpk file is created in the project folder. Next, you'll view it in ArcGIS Pro.

  6. Open your Earthquakes of 2017 project in ArcGIS Pro.
  7. On the ribbon, click the Map tab. In the Layer group, click Add Data.
  8. Browse to and add earthquakes_2017_blue_circles.vtpk to the map.

    The new layer shows your updated blue circles instead of the original default point symbols.

    Blue circles

  9. Save the project and close ArcGIS Pro.

You've extracted the contents of a vector tile package, edited the style JSON to replace the default point symbols with simple blue circles, repackaged the vector tiles, and verified your changes. At this stage, the blue points don't look much better than the default symbols. Next, you'll continue editing the style to vary the circle size by earthquake magnitude, add more color, and include a blur effect to make the points appear to glow.


Add blur effects and data-driven styling

Previously, you edited the style in a vector tile package to change the appearance of point symbols from default icons to blue circles. Next, you'll update the symbology to use a radial gradient blur effect with circles that vary in size based on earthquake magnitude. You'll also customize the color scheme by duplicating the point layer with varying scales and tints. When added to a map with a dark background, it will create a glowing effect that highlights groups of earthquakes.

Vary circle radius by earthquake magnitude

The blue circles you generated in the previous lesson do not illustrate the magnitude of each earthquake. By making a few additions and changes to the style JSON file, you'll vary the size of each circle so that earthquakes with higher magnitudes are larger.

  1. Browse to the folder where earthquakes_2017_blue_circles.vtpk is located.
  2. Right-click earthquakes_2017_blue_circles.vtpk, point to 7-Zip, and choose Extract files.
  3. Click OK.

    A new folder named earthquakes_2017_blue_circles is created containing the extracted vector tile package contents.

  4. In the folder named earthquakes_2017_blue_circles, open the p12 > resources > styles folders.
  5. Right-click root.json and choose Edit with Notepad++.

    JSON text

    To change the size of the earthquake points, you'll add the circle-radius property inside the paint object. The object already has a property, so you'll need to add a comma before adding a second.

  6. Add a comma to the end of "circle-color": "#00C8D6". Press Enter to create a new line and type "circle-radius":.

    Circle radius property

    The circle-radius property accepts a number or an object as the value. If you set it to a number, every circle will have the same radius in pixels equal to the number. You want to vary the radius of each circle by an attribute value, so you'll create a property function. Property functions are defined inside objects.

  7. Type {, press Enter twice, and type }.

    Empty circle radius property

    Next, you'll identify the name of the attribute field to be used in the property function. The earthquake magnitude is stored in the mag field, which you included by highlighting in the table before creating the vector tile package. To identify the attribute inside the property function, you'll set the value of property to mag.

  8. In the empty line between the braces, type "property": "mag".

    Magnitude property ID

    Next, you'll define the size of the circle radius for each magnitude value. You'll do so by creating stops. A stop has two values: the first is an input value and the second is an output value. Your stops will contain an input value of magnitude and an output value of the circle radius.

  9. Add a comma to the end of the line that reads "property": "mag", press Enter, and type "stops": [].

    Stops property

    You'll add two stops. One will contain the minimum circle radius and one will contain the maximum circle radius.

  10. Add two empty lines inside the brackets after "stops". In the first empty line, type [4, 10] and add a comma. On the second empty line, type [8, 100].

    Stops for minimum and maximum circle radius

    The first stop indicates that earthquakes with a magnitude of 4 or lower will have a size of 10 pixels. The second stop indicates that earthquakes with a magnitude of 8 or higher will have a size of 100 pixels. Earthquakes with magnitudes between 4 and 8 will have sizes between 10 and 100 pixels.

    Before you repackage the vector tiles to display and check your work, you'll make two more changes to the point symbols. First, you'll add a blur effect. Then, you'll lower the opacity to make large groups of overlapping circles stand out more.

  11. Create a new line under the circle-color property and type "circle-blur": 1. Add a comma at the end.

    A circle blur value of 1 blurs the circle so that only the center of the circle is at full opacity.

  12. Add another line and type "circle-opacity": 0.05. Add a comma at the end.

    An opacity value of 0.05 will set the circle opacity to a value of 5 percent.

    Circle blur and circle opacity

  13. Save the JSON file and close Notepad++.

Repackage the vector tiles

To check your work, you'll repackage the vector tiles and add them to a map in ArcGIS Pro.

  1. Browse to the folder containing the extracted vector tile package. Select the esriinfo and p12 folders using Ctrl.
  2. Right-click the highlighted folders, point to 7-Zip, and choose Add to archive.
  3. For Archive, type earthquakes_2017_blue_blurs.vtpk.
  4. For Archive format, choose zip. For Compression level, choose Store.
  5. Click OK.

    A new file named earthquakes_2017_blue_blurs.vtpk is created in the folder. Once again, you may want to copy your new .vtpk file to the default project folder.

  6. Open your Earthquakes of 2017 project in ArcGIS Pro.
  7. In the Contents pane, uncheck all layers to turn them off.
  8. On the ribbon, click the Map tab. In the Layer group, click Add Data. Browse to and add the earthquakes_2017_blue_blurs.vtpk vector tile package to the map.

    Blurred blue circles

    These points would look better on a dark background. You'll add a dark basemap to make the blue blurs stand out more.

  9. On the Map tab, in the Layer group, click Basemap. Choose Dark Gray Canvas.

    A dark basemap is added to the map.

    Blue blurred circles on a dark basemap

Add duplicate layers with varying symbology

Lastly, you'll add more color to the circles to enhance the look (based on the design in this blog post). You'll duplicate the point layer and assign different circle sizes and colors to each.

In the style JSON file you've edited, most of your work has been inside the layers object. The value of layers is an array of objects. Each object represents a layer with all its properties. Currently, there's only one object in that array: the original earthquakes layer.

You can duplicate the layer by copying and pasting it after the existing one. Layers are rendered from the first layer down in ArcGIS Pro, meaning each layer is displayed on top of the layer defined above it.

  1. Extract earthquakes_2017_blue_blurs.vtpk using 7-Zip. Open the p12, resources, and styles folders.
  2. Right-click root.json and choose Edit with Notepad++.
  3. Highlight the entire object representing the earthquakes layer, including the braces enclosing it.

    Highlighted layer object

  4. Right-click the highlighted text and choose Copy.
  5. Add a comma after the last closing bracket in the layer object.

    Comma added after the layer object

  6. Create a new line after the comma. Right-click the new line and choose Paste.

    A copy of the earthquakes layer is added to the layers array.

    Duplicate layer

    You'll change the duplicate layer's id, color, and stops values. You'll give the duplicate layer a green color with smaller circles.

  7. In the duplicated layer object, make the following changes:
    • Update id to "quakes_2017_02".
    • Update circle-color to "#D1FF73".
    • Update the first stops value to [4, 4].
    • Update the second stops value to [8, 35].

    New ID, color, and stops

    Next, you'll repeat the steps to create a third layer with a different ID, color, and circle-radius stops.

  8. Add a comma after the last closing bracket in the layer object. Create a new line after the comma. Right-click the new line and choose Paste.
  9. In the duplicated layer, make the following changes:
    • Update id to "quakes_2017_03".
    • Update circle-color to "#FFFFBE".
    • Check that the first stops value is set to [4, 4].
    • Update the second stops value to [8, 15].

    Finally, you'll repeat the steps to create a fourth layer.

  10. Add a comma after the last closing bracket in the layer object. Create a new line after the comma. Right-click the new line and choose Paste.
  11. In the duplicated layer, make the following changes:
    • Update id to "quakes_2017_04".
    • Update circle-color to "#FFFFFF".
    • Update the first stops value to [4, 1].
    • Update the second stops value to [8, 5].
  12. Save the JSON file and close Notepad++.

    You now have four versions of the earthquakes layer, each with different coloring and circle sizes. The style is complete. You'll add the earthquakes to your map to see how they look.

  13. Browse to the folder containing the extracted vector tile package. Highlight the esriinfo and p12 folders and compress them using 7-Zip. Name the archive earthquakes_2017_blue_green_blurs.vtpk and set Compression level to Store.

    A new file named earthquakes_2017_blue_green_blurs.vtpk is created.

  14. Open your Earthquakes of 2017 project in ArcGIS Pro.
  15. Add the earthquakes_2017_blue_green_blurs.vtpk vector tile package to the map.
    Note:

    If your layer does not display successfully, you can download a completed version.

    Completed earthquake map

  16. Explore the map. Try to identify the Ring of Fire in the Pacific Ocean and the Mid Atlantic ridge between Europe and the Americas.
  17. Zoom to several of the bright clusters of earthquakes. Locate Indonesia and examine the number and magnitude of earthquakes in the region.

    Zoomed-in completed earthquake map

  18. When you finish exploring the map, save the project.

Share the vector tiles

Vector tiles are ideal for sharing because they have a low file size and fast rendering performance online. You'll share your vector tile package as a hosted tile layer on your ArcGIS Online account.

  1. Open a new browser window.
  2. Sign in to your ArcGIS organizational account.
    Note:

    If you don't have an organizational account, you can sign up for an ArcGIS free trial.

  3. On the ribbon, click Content.
  4. Click Add Item and choose From my computer.

    The Add an item from my computer window opens.

  5. Under File, click the Choose File button.
  6. Browse to and select earthquakes_2017_blue_green_blurs.vtpk. Click Open.
  7. Confirm that Publish this file as a hosted layer is checked.
  8. For Tags, type earthquakes.
  9. Click Add Item.

    Your vector tile package is uploaded to your ArcGIS Online account as a hosted tile layer.

In this lesson, you created a vector tile package from earthquake data and customized the appearance of the earthquake points by editing the style JSON file stored inside the vector tile package. Through layer duplication, blur effects, and data-driven symbology, you enhanced the symbology of the earthquake points to create colorful glowing flares that highlight clusters of large earthquakes and reveal earthquake patterns across the globe. Now that you know how to create vector tile packages and manually edit the style, you can apply these skills to edit the symbology in other vector tile layers.

This lesson covered only a small portion of what is possible through style editing. ArcGIS Pro supports the style specification developed by Mapbox. By adding and editing JSON properties to other vector layer types, you can create and fine-tune the appearance of any point, line, or polygon layers using data-driven symbology to design a nearly infinite number of vector tile map styles. Get inspired to experiment by taking a look at these Firefly Recipes.

You can find more lessons in the Learn ArcGIS Lesson Gallery.