Map Service
Publish service
Function Description
This feature allows you to publish map documents, ArcGIS REST services, map document folders, Shapefile folders, GeoJSON data, and GIS layer data as MapGIS standard map services.
Tips:
When publishing a service, you can only select the corresponding files in the registered folder. See " Folder " for detailed steps.
Operating Instructions
1. On the Service Admin page, click " Publish Service " - " 2D Map Services " - " Map Service " to launch the Map Service Publishing page;
2. Set Basic Information, you can set the following information:

- Data Source Type: You can choose from Map Document, ArcGIS REST Map Service, Map Document Folder, Shapefile Folder, GeoJSON Data, and GlS Layer Data;
- Map Document: MapGIS map document, which must contain a 2D map. You can select data from the folder management or upload local files directly.
- Map Document Folder: This folder contains multiple MapGIS map documents. You can choose a folder from the folder management section or upload a local folder directly.
- ArcGIS REST Map Service: ArcGIS Rest map services allow you to access and manipulate service resources via URLs;

Data path: Enter the URL address of the service;
Security authentication methods: You can choose from three methods: no security authentication, username/password, or token.
- Shapefile Folder: A folder containing multiple Shapefile files. You can choose a folder from the folder manager or upload directly to a local folder;
- GeoJSON Data: After configuring the data source for importing GeoJSON data, you can directly publish GeoJSON files as map services. You can choose data from the folder management or directly upload local files.

- GlS Layer Data: Directly publish layer data from the data source as a map service.

- [Data Path]: Click the " Select " button on the right to choose the storage path of the data source on the server;
- [Select Map]: You can select one of the maps in the map document;
- [Service Name]: Sets the name of the current service;
- [Belonging Folder]: Sets the current service's parent folder;
- [More Options]: Enable dynamic projection. For map documents and map document folders, you can directly enable dynamic projection to project the map onto the desired reference system.
3. Perform service configuration. You can enable other services and configure their interfaces in the " Service Configuration " section:

4." Layer Filter " allows you to configure which layers and fields within those layers can be queried when publishing a service. After configuration, queries on the service will only retrieve the configured layers and fields.
- To use " Layer Filter ", you need to control whether to enable setting query filtering conditions when publishing services through configuration options. Go to " Settings " - " Service Management Config ", "Enable Static Layer Filter For Publishing", and "Save".

Tips:
This configuration only controls whether layer query filtering can be set when the service is published. If layer query filtering has already been set but is turned off, it will still take effect.
- "Layer Filter" is off by default, meaning all layers and fields can be queried. Turning it on allows you to select layer query filters, choose the layers and fields you want to query, and then confirm and publish.

5. Configure "Map Tile Cache" the following information can be set:
Tips:
1. After enabling map tile caching, when publishing a " Map Service ", a " Tile Service " will be generated simultaneously. This service can be called through the interface methods of either the "Map Service" or the "Tile Service".
2. Dynamic tile caching automatically generates tile data the first time a specific scale and area are viewed, allowing subsequent views to directly access the tile data. The generated tiles are stored in the "MapGIS installation directory\igserver_for_java\tileCache" directory.

[Map Tile Cache]: Enable/Disable map tile caching;
[Cache Type]: You can choose from three caching methods: dynamic tile caching, associated tile data, and associated tile service;
Dynamic Tile Cache: The server generates images based on the requested range and returns the images to the client;
- Dynamic Tile Scheme Settings: Set the reference system for the tile map. You can choose from three reference systems: Longitude/Latitude, Web Mercator, and User Defined.
- Tile Size: Sets the height and width of the tile map image, typically 256 pixels and 512 pixels;
- Tile Format: Sets the image format for the tile map, providing GIF, PNG, and JPG formats;
- Level: Set the number of tile levels according to application needs;
- Origin Point: Set the origin point (X, Y) for cropping tiles, such as the top left corner, bottom left corner, top right corner, etc., depending on the tile cropping strategy applied (MapGIS IGServer defaults to the top left corner as the origin).
- Range: This is the set cropping range, which is set by default based on the current map range;
- Resolution/Scale: Set the resolution/scale for each cropping level. You can customize the resolution/scale for each level or use the default resolution/scale (the resolution/scale of two adjacent levels is 2 times).
Associate Tile Data: You can associate map tile data pre-stored on the server, or tile data stored in MongoDB and PostgreSQL databases. You need to select the associated tile service path, as shown in the image below:

Associate Tile Service: Select an existing tile service. At this point, ensure that the spatial reference system, data range, and display effect are consistent with the map service; otherwise, abnormal display and query results may occur. You need to select the name of the associated tile service, as shown in the image below:

[WMTS Service/OGC API-Tiles]: For 2D map services with dynamic tile tiling enabled, you can select the WMTS Service/OGC API -Tiles supported by the dynamically tiling. After enabling, you can select the supported interface types.

- EPSG Name: Click the drop-down box to the right of the EPSG name and select the correct map reference system;

[Enable Tile Encryption]: Enabling map tile caching allows you to set encryption algorithms for the tile service, including SM4 and AES. After encryption, the frontend needs to decrypt the tile when calling the service.
- Use default IV: When checked, the default IV value is used, and the same default IV value needs to be configured when displaying it on the front end; when unchecked, independent IV value information will be recorded in the tile service information.
- Whether to make the key and IV public: When checked, the key and IV information in the tile service information will be stored publicly; otherwise, the key and IV will be encrypted again to generate the secretMsg value.

6. Access permissions for the service can be configured in the " Security Settings " section.


- Public: This service is accessible to any user;
- Private: Only specified users/roles can access this service. The service access address is "{service address}?token={user token information}", such as [http://192.168.81.115:8089/igs/rest/services/LandUse/TileServer?token=SHdwb2pWQXRKcFdxK3lnb2ZIK0pQOFRHQWtsVnd4Y0JiWDNOTU9PajI5az0=]. For token configuration methods, please refer to the section Token Configuration.

Tips:
1. When clicking " Preview " in "Service Management" or the service base address in "Service Details," IGServer's built-in whitelist feature will not require token information. However, if you copy the service's preview address or base address to a new webpage and open it, you will be prompted to enter token information.
2. Token restrictions will only be enabled if tokens are enabled in the "Security Configuration" section and access restriction information is set for the service.
7. Click the " Publish Service " button to publish the current map service.
Service Details
Function Description
After publishing a service, you can view its detailed information in the service details section, and you can also modify some parameters.
Operating Instructions
1. Click the " Details " button next to the service to view the service details.
2. The basic information includes service name, service alias, belonging folder, data source type, service address, etc.;

- [Service Alias]: Users can modify the alias information when they wish to change the service name. After modifying the alias, all services will be displayed using the alias information.
- [Service Address]: This section displays the service addresses for all types of services published by this service;
- [Reload Service]: Clicking "Reload Service" will reload the service. This function allows you to synchronize service information when the service's data source information changes. For example, when publishing a map document service, if the Mapx map information changes, you can reload the service to load the latest map information.
2. The service configuration, map tile cache, and security settings are the same as those in " Publish Service ", and will not be described again here.
3. Click " Save " to save the edited information.
Preview service
1. After successfully publishing the map service, the page will return to the service list. Click the " Preview " button to the right of the current service to enter the Map Viewer page. For detailed instructions, please refer to " Service Preview ".

2. After successfully publishing the map service, click to enter the service details page, and then click the service address to view the base address of the map service.
