Instructions for use
Support the generation of vector maps into Vector Tile following the MapBox MVT specification. Tile Data contains the geometry and Attributes of features, and the style of features is described by the MapBox standard style file (style. JSON). Compared with Raster Tile, Vector Tile has the advantages of stepless scaling, style modification and relatively small amount of data, which can better meet the flexible and diverse Web Map Aplication. For a description and comparison of Raster Tile and Vector Tile, see the Map Tiles type page. In this section you will learn the following:
Vector Tile style
The Vector Tile generated by SuperMap will be displayed on the SuperMap iClient client based on the MapBox style file. The client uses MapBox GL or Open Layers to render and display the Vector Tile. Point, line, surface and text layers in the SuperMap map can be cut into Vector Tile (if the map contains other layers, such as image and Raster Layer, these unsupported layers will be ignored when cutting Vector Tile). Layer Style, etc. Will Generate Tiles Style files according to the style specifications of MapBox GL version 8. For MapBox styles, see: https://www.mapbox.com/mapbox-gl-style-spec . As the MapBox GL version is upgraded, the MapBox styles are updated accordingly.
Figure: Client displays Vector Tile using MapBox GL rendering |
Generate Vector Tile
- Create New Task: In the Generate Map Tiles (Single Task) dialog box, you can select three single-task cutting methods: Create New Task, Update/Append Tiles, and Resume/Restore Tiles. Select the Create New Task item here.
- Set scale information: Set the scale parameters of Generate Tiles in the Single Task: Generate Map Tiles dialog box. The program will automatically generate a list of scales according to the map data. You can modify the scale information through the scale toolbar, including switching the scale scheme, Add Scale, and importing the Export ScaleConfig File or Tile Config File. Hint:
- The Tile Config File (*.sci) holds the scale of the Generate Map Tiles as well as other Tile production parameters.
- ScaleConfig File only records the scale information.
- Parameter Settings:
- Tile Type:: Select a Vector tile.
- The size of tiles: The size of each generated Tile in PX (pixels). Two sizes of 512 * 512 and 256 * 256 are provided, and the Default Size is 512 * 512.
- Generate font cache file: Generate the font file of the map. When the user needs to update the font style separately, check this option to generate the Result Storage in the fonts folder.
- Tile Range: Set the TileTile Range, and each tile expands around according to the set range value, that is, the generated tile contains the data within the buffer range. The meaning of setting Tile Range is that the boundaries of adjacent tiles can be seamlessly connected when browsing Tiles. The default value is 16 in pixels.
- Add All Attribute Fields: Check this option, and the generated Tile results include all Non-system Fields: of the corresponding DatasetGeometry. Otherwise, the program only outputs the fields used by the map display.
When the user uses Tile in the front end and needs to use other fields for data query and other applications, this item can be checked to output all Property Field values. However, when there are many layer fields, the generation efficiency will be slower.
- Generate Vector Tile: The Generate Vector Tile is selected by default, and the Result Storage is in the tiles folder. The parameter is not available when the Generate Map Tiles by Multiple Tasks is used.
- Rarefy Display: If this parameter is checked, the program will perform rarefaction on the Geometry with a small scale to improve the display performance. If it is not checked, it means no rarefaction.
- Generate Tiles Style: checked by default, unchangeable. Generate the *.json file containing the Map Corres ponding Style, and generate the Result Storage in the sprites and styles folders. The parameter is not available when the Generate Map Tiles by Multiple Tasks is used.
- Generate Index: Checked by default. If there is a vector surface in the generated Vector Tile, the vector surface will be triangulated into a triangular mesh. The triangular mesh index will be generated to speed up the loading of WebGL.
- Separate Data from Style: if this parameter is checked, it means Separate Data from Style; if it is not checked, it means Not Separate Data from Style. When you need to update the data or style of Vector Tile separately later, you need to check this parameter to facilitate updating the data or style of Vector Tile separately.
Warning:Independent generation and updating of Vector Tile data and styles is not supportedif a layer in the map uses Filter Expression or if the label has a background. Otherwise, the generated Tile Data corresponds to the wrong style.
- Save Settings:
- Tile Name: The name of the Generate Tiles folder, which is Map Name by default. When a tile with this name already exists in the storage directory, click Next and you will be prompted that the "China100 _ 2021" file already exists. Please re-enter the Tile Name or the storage directory.
- Storage Format: Provides three Storage Formats: Compact, Raw, and MongoDB. For a Detail Description of the Storage Format, see TileStorage Format.
- Storage mode: is the storage mode of Generate Tiles, including Local and Cloud Storage.
- Select Local. The generated Tile and intermediate files will be stored in the local path specified in the storage directory.
- If you select cloud storage, you can select a cloud storage path in the storage directory to store Tile files. You need to Add Cloud Storage Connection before using the cloud storage path; At the same time, the working directory needs to be set, and the intermediate files generated in the process of cutting will be stored in the local path specified by the working directory.
- Storage directory: is the storage path of Generate Tiles.
- Working Directory: The storage method needs to be set when selecting cloud storage or Storage Format and selecting MongoDB. It is used to store the intermediate files generated in the process of graph cutting, so as to facilitate the transmission and update of Tile.
- Tile Bounds : Set the Geographic Range of the map data, and the program will Generate Map Tiles according to this range. The following settings are available:
- Whole Map: Use the range of Whole Map as Tile Bounds, and the four text boxes at the bottom left and top right are used to display the set processing range;
- Current Windows: Use the range of Current Windows as the Tile Bounds.
- Custom Bounds: Click the Drop-down Button to set Tile Bounds by selecting Select Object, Draw Rectangle, or Custom Expression.
- Select Object: The program switches to the current Map. Click an object as the processing range of the Tile. If multiple objects need to be selected, press and hold the Shift key to select objects in turn. After the selection is completed, click the right mouse button to end the selection state. Return to the Generate Map Tiles dialog box.
- Draw Rectangle: Switch the program to the current Map, use the mouse to Draw Rectangular Range in the window, click the right mouse button after drawing, end the selection status, and return to the Generate Map Tiles dialog box.
- Custom Expression: The program will pop up the SQL Expression dialog box, which supports the determination of Tile Bounds by setting the SQL Expression. The minimum Bounds of the expression Search Result is the Generate Tiles range.
- Copy and Paste: The program provides Copy and Paste buttons for copying Geographic Range. Click the Paste button at the Range Settings supporting paste to set the left, lower, right and upper values of Copy Bounds to the current range.
- Filter Select Object Layer: When Tile Bounds is set as the custom range mode of Select Object, check this item, and the program will automatically filter the object layer when Generate Tiles; otherwise, it will not filter. This feature only works when there are multiple layers in the map.
- Origin of Tile: This is the basis of the Map Tiles splitting rule. When the Origin of Tile is determined, the segmentation rule of the Tile can be determined. Map Tiles with the same Origin of Tile can be merged. Vector Tile does not support modifying Index Bounds. For Geographic Coordinate System maps, Index Bounds is always -180, 90; For Projected Coordinate System maps, Index Bounds is always the upper-left corner of the Map Bounds.
- After setting the above parameters, you can execute the Map Tiles cutting operation.
- The map of the
- Planar Coordinate System does not support Generate Vector Tile. If the map is not a Planar Coordinate System, but the Dataset corresponding to the layer is a Planar Coordinate System, the coordinate system of the Dataset needs to be changed to a non-Planar Coordinate System. Update/Append tiles are not supported for
- Vector tiles. Resume/Restore tiles are not supported.
Vector Tile Results Directory
When the Execute Map Cache Task is completed, the Output Window will prompt that the generation of plane Map Tiles is successful. Under Export Directory, folders and files will be produced as shown below.
Figure: Vector Tile Directory Structure |
- Fonts: The font file used by Vector Tile.
- Sprites: Vector Tile icon related style content resource.
- Styles: Vector Tile style description file.
- Thumbnail: used to store the thumbnail of the Vector Tile.
- Tiles: Vector Tile data. When Storage Format is Raw, the generated Tile format is a *.mvt file; when Storage Format is Compact, the generated Tile format is a *.cf file.
Under the Tiles folder, tiles are stored in folders according to the scale level. The Folder Name is the Global level, and the number of levels is counted from 0. The subfolder under the hierarchical folder is named as the column number of Global, and the File Name is the row number of Global.
- Sci file: Meta-information description file of Vector Tile, recording data projection, Geographic Range, level scale and other information.
Generate Vector Tile style
One of the most important features of Vector Tile is that the Tile Data is independent of the style. Therefore, you can change the Display Effects of the Vector Tile map by modifying the style of the Tile without RebuildVector Tile.
Provide a separate Generate Vector Tile Style entry, and generate the corresponding map style separately without changing the Tile Data. The specific operation is as follows:
- Open the vector map, and select Generate Vector Tile Style in the MapContext Menu to pop up the Generate Vector Tile Style dialog box.
- Set the path of the generated style in the dialog box to generate a new Vector Tile style.
- The result file contains three folders, including fonts (font files used by Vector Tile), sprites (Vector Tile icon related style content resources), and styles (Vector Tile style description files).
- And finally, replacing the content of the newly created Vector Tile style into the Vector Tile directory of the style to be updated so as to display the current Vector Tile according to the newly generated Tile style.
Related topics
Vector Tile Drawing Considerations