To fully leverage the capabilities of the Vector Tiles Service V2, such as multi-style browsing, multi-level filtering, and high-performance rendering, iServer provides three properties modules: style, data, and cache, offering full-link management functions. This section will introduce the specific configuration process and considerations.
Operation Steps
Function Entry:
- Service Management Home‐>Service‐>Service Management tab‐>Specify Vector Tiles Service V2
Operation Instructions:
(1) Style Management
After the service is published, you can directly use the default style provided by iServer for browsing. However, you may have already styled the map using SuperMap iDesktopX in advance. To apply the corresponding style in the service, you need to perform the following operations:
- In SuperMap iDesktopX, use the "Export Map to WebMap" tool to output the styled map as a WebMap JSON file.
- In the iServer service details - Style tab, click Add Style.
- If the style is on the machine where iServer is located, select the specified WebMap JSON file and click OK.
- If the style is on a local machine rather than the iServer machine, compress the WebMap JSON file along with related sprite and font files into a .zip package according to the specified directory structure (see Notes for details), then click Upload Data. Select the specified WebMap JSON file and click OK.
- After adding, click Save.
- To ensure the added style can be correctly applied by iServer, you need to modify the style. Click Edit to enter the style editor. The specific editing methods are as follows:
- In the visual editing interface, set the "Data Source" to the database name used during service publishing; set each "Layer" to "Dataset@DataSource", where 'Dataset' is the dataset selected during service publishing and 'DataSource' is the database name used during service publishing.
- (Recommended) In the visual editing interface, click "One-Click Optimization", and iServer will automatically perform the above modifications for you.
- In the JSON editing interface, you need to modify the values of the sources node and all source values in the layer nodes, as well as the source-layer values in the JSON file as described above.
- After completing the style editing, click Save. If the style contains a
filternode, iServer will prompt you to go to the data management module to add the corresponding attribute field and provide relevant dataset and attribute field information. After completing the configuration, return to the style management module to edit and save the style. - After completing the above configuration, you can click Preview to preview maps with different styles in the Leaflet view. If a style is no longer needed, you can also delete it. After Deleting, click Save to apply the change.
(2) Data Management
To control the visible range of data and optimize tile generation efficiency, iServer provides SQL condition filtering and attribute field selection functions, supporting the addition of corresponding conditions to published datasets. The specific operations are as follows:
- In the iServer service details - Provider tab, configure the following:
- Buffer Range: Set the tile buffer range. Each tile expands outward by the set range value, meaning the generated tile includes data within the buffer range. The significance of setting the buffer range is to ensure seamless connection of adjacent tile boundaries during browsing. The default value is 16, in pixels.
- Simplify Display: Supports checking. iServer will simplify geometry objects at small scales, improving display performance. If unchecked, no simplification is performed. Not checked by default.
- In the iServer service details - Data tab, click Add Data and configure the following:
- Dataset: Select the dataset to which you want to add data conditions. The selected dataset will be rendered as a layer. By default, the dataset selected during service publishing is displayed.
- Filter Options: Filter the required feature objects from the selected dataset based on the filter conditions. This setting applies to all styles in the service. Single SQL filter condition can be entered. For example: dlbm='011' or dlbm='013'.
- Attribute Fields: Supports selecting the attribute fields to be included from the selected dataset for querying and styling. Must include the field name used in the filter node conditions of the style. If not selected, the generated tiles will not contain attribute information.
- After configuration is completed, click OK. After the popup closes, click Save.
(3) Cache Management
To ensure high-performance rendering of the map, iServer provides a series of caching mechanisms for the Vector Tiles Service V2. You can configure them as needed. The details are as follows:
- In the iServer service details - Cache tab, configure the following:
- Enable Caching: Enabled by default. When enabled, the service will prioritize using raster and vector pre-cached tiles at the specified storage location. If pre-cached tiles do not exist, dynamic caching will be performed to ensure map rendering performance.
- Vector Storage Location: Currently only supports ./output/MVT
- Vector Pre-Cached Tiles: Displays the locally existing vector cache levels (including dynamic cache and pre-cache).
- Raster Storage Location: Currently only supports ./output/cache
- Raster Pre-Cached Tiles: Displays the locally existing raster cache levels by style (including dynamic cache and pre-cache).
Notes
- The uploaded style file package (*.zip) must satisfy the following directory structure:
Root Directory/
├─ WebMap.json
├─ sprites/
└─ fonts/
- When a dataset contains a large volume of data, it is recommended to create pre-cached tiles in advance; otherwise, map rendering performance and quality may be affected.
- If the service already has pre-cached or dynamic cached tiles, and you modify the relevant settings in the data management module, you must clear all caches and regenerate them; otherwise, the old cache will be used and the modifications will not take effect.
- When previewing styles, if the current service has no pre-cached tiles, the minimum zoom level is 12.
Related Topics
- Overview of the New Generation Vector Tiles Service
- Publish Services
- Pre-Caching Production
- Using the Service