In the previous lesson, you created a vector tile package with earthquake points using the default point symbology. In this lesson, 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
- Browse to the default project folder where earthquakes_2017.vtpk is located.
- 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.
- Click OK.
Two new folders, p12 and esriinfo, are extracted.
- Open the folders p12 > resources > styles.
- 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.
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.
- On the ribbon, click Plugins, point to JSTool, and choose JSFormat (Shortcut: Ctrl+Alt+M).
The JSON file is formatted.
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.
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.
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.
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.
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.
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.
- In line 13, replace "symbol" with "circle".
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.
- Delete the text in the lines that contain the icon-image, icon-allow-overlap, and icon-color 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 code Color RGB percent CMYK
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
82 percent red, 100 percent green, 45.1 percent blue
18 percent cyan, 0 percent magenta, 54.9 percent yellow, 0 percent black
100 percent red, 100 percent green, 74.5 percent blue
0 percent cyan, 0 percent magenta, 25.5 percent yellow, 0 percent black
100 percent red, 100 percent green, 100 percent blue
0 percent cyan, 0 percent magenta, 0 percent yellow, 0 percent black
- On a new line inside the paint property object, type "circle-color": "#00C8D6".
- 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.
- Browse to the project folder, Earthquakes of 2017. Select both the esriinfo and p12 folders by pressing Ctrl while clicking them.
You can also select the folders by drawing a box around them.
- Right-click the selected folders, point to 7-Zip, and click Add to archive.
The Add to Archive window opens.
- In the box next to Archive, type earthquakes_2017_blue_circles.vtpk.
- For Archive format, choose zip. For Compression level, choose Store.
- Click OK.
The earthquakes_2017_blue_circles.vtpk file is created in the project folder. Next, you'll view it in ArcGIS Pro.
- Open your Earthquakes of 2017 project in ArcGIS Pro.
- On the ribbon, click the Map tab. In the Layer group, click Add Data.
- 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.
- Save the project and close ArcGIS Pro.
In this lesson, you 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. In the next lesson, 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.