MapStudio WebApp supports set and use custom Web symbols, configure the maximum number of nodes supported for feature snapping. In this section, we will describe the extension process of MapStudio WebApp in detail.
Custom Web symbol
- Locate and extract the webjar-mapstudio-*.jar file in the path [iPortal product package]/webapps/iportal/WEB-INF/lib/. Open the MapStudio.json configuration file in the extracted directory under /META-INF/resources/apps/mapstudio/config, and configure the custom symbols in this file. Example code is as follows:
{
"customSymbols": {
"iconIds": [
{
"name": "Scooter",
"path": "./customSymbol/custom-0.png"
},
{
"name": "Ping pong",
"path": "./customSymbol/custom-1.png"
},
{
...
}
]
}
}
- Place the custom symbol images in the META-INF/resources/apps/mapstudio/static/symbols directory within webjar-mapstudio-*.jar. Currently, JPG and PNG formats are supported for symbols.
- Re-compress the MapStudio.json file into webjar-mapstudio-*.jar
- After configuration, reopen MapStudio. The custom symbols will appear under the 'Custom' tab in the general symbol panel, as shown in the following figure:
Support adding primary and secondary classifications to custom symbols through configuration for categorized management and precise retrieval. Example code is as follows:
- Configure 'category' parameter to add a primary classification to custom symbols.
{
"customSymbols": {
"iconIds": {
"pointColor": [
{
"name": "Red",
"path": "./customSymbol/custom-0.png"
},
{
"name": "Green",
"path": "./customSymbol/custom-number.png"
},
{
...
}
],
"pointShape": [
{
"name": "Circle",
"path": "./customSymbol/custom-0.png"
},
{
"name": "Semicircle",
"path": "./customSymbol/custom-number.png"
},
{
...
}
]
},
"category": [
{
"value": "pointColor",
"label": "Color"
},
{
"value": "pointShape",
"label": "Shape"
},
]
}
}
The primary classification will be displayed under the Custom tab, as shown in the following figure:
- Configure 'category' and 'subCategory' parameters to add primary and secondary classifications to custom symbols.
{
"customSymbols": {
"iconIds": {
"pointColor": {
"pointRed": [
{
"name": "Target",
"path": "./customSymbol/custom-0.png"
},
{
...
}
],
"pointGreen": [
{
"name": "Cauliflower",
"path": "./customSymbol/custom-4.jpg"
},
{
...
},
]
},
"pointShape": {
...
}
},
"category": [
{
"value": "pointColor",
"label": "Color"
},
{
"value": "pointShape",
"label": "Shape"
}
],
"subCategory": {
"pointColor": [
{
"value": "pointRed",
"label": "Red"
},
{
"value": "pointGreen",
"label": "Green"
},
{
...
}
],
"pointShape": [
{
...
}
]
}
}
}
The primary and secondary classifications will be displayed under the Custom tab, as shown in the following figure:
Configure the maximum number of nodes supported for feature snapping
During feature editing, if the cumulative number of nodes of features within the view exceeds a certain maximum threshold, snapping will be disabled. This maximum threshold is configurable, and if not configured, it defaults to 100,000. The configuration method is as follows:
Locate and extract the webjar-mapstudio-*.jar file in the path [iPortal product package]/webapps/iportal/WEB-INF/lib/. Open the MapStudio.json configuration file in the extracted directory under /META-INF/resources/apps/mapstudio/config, and configure the maximum number of nodes supported for feature snapping in this file, it must be greater than 0. Example code is as follows:
{
“snapMaxVertex": 80000
}