当前位置:网站首页>New function of SuperMap iserver11i -- release and use of legend
New function of SuperMap iserver11i -- release and use of legend
2022-06-30 12:26:00 【supermapsupport】
author :yyy
Preface
A map legend is a symbol that represents geographical things on a map , It is the description of the contents and indicators represented by various symbols and colors on the map , Focus on one corner or side of the map . The legend shall conform to the principles of completeness and consistency . The legend has a dual task , When compiling a map, it serves as a criterion for diagramming the contents of the map , As an essential reading guide when using drawings . It helps users to use the map more conveniently 、 Understanding map content .
Currently in SuperMap iServer11i In the new version, the map service has added legend Sub resources , It supports obtaining the legend information of all map layers at one time , You can also return the specified range 、 Specify the legend information of the layer , Next, we will try it out SuperMap 11i Beta Version of the series products to realize the application of the legend .
One 、 Make and publish legend
adopt SuperMap iDesktop When making the map of the product, we were “ Layer manager ” Create a new layer group in , Layer control , Change the layer style 、 Create thematic maps, etc. to build a default or custom legend map ; Then save the map 、 Save the workspace . The picture below is through SuperMap iDesktop 11i Beta Two maps produced by version , One of them is through custom layer groups 、 legend 、 A map made by means of thematic maps ; The other is that only the layer group is set , The legend uses a map made by default , The display effect of the two maps is as follows :


When the map is made, we can go through SuperMap iServer 11i Beta Version publishes the above workspace as a map service , Then in the map service “ The following operations are supported ” There will be one in the list “legend” Figure example resources , When you click to access “legend” Then we can see in “ Layer legend list ” The legend objects of all layers in the current map are displayed one by one , Here you can find that the effect in the currently displayed legend object follows iDesktop in “ Layer manager ” The effect is consistent in , Both contain layer group content .

Two 、 Application of legend
When we get the legend information, how can we get its specific style and use it ? Here's how to get the legend details and style content by request . Through the above service address , We can see that the request header format of the legend object has a default fixed content , Such as :" Map service address "+"legend"+"?"+"bbox=xmin,ymin,xmax,ymax"; The representation format of the legend object by changing is rjson after , We can more clearly see the description of a legend object by default :
{"layerLegends": [{
"subLayerLegends": [
{
"subLayerLegends": [{
"subLayerLegends": null,
"layerType": "UGC",
"legends": [{
"imageData": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAJUlEQVQ4jWNMS0v7z0ABYAERVZk1ZBvARIntowaMGjBqABUNAABexQOygF8COgAAAABJRU5ErkJggg==",
"values": null,
"width": 16,
"label": "[email protected]",
"contentType": "image/png",
"url": "http://localhost:8091/iserver/output/resources/testcountries/SYMBOLFILL/0_-58026551.png",
"height": 16
}],
"maxScale": 0,
"layerName": "[email protected]",
"minScale": 0
}],
"layerType": "UGC",
"legends": [{
"imageData": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAVElEQVR42mNgGBRA3rP2CBD/x4LPKLtVyxJjwH88+D4QG1JiABquO0yhAbVHcBog51lrTW4ggg0gEKC4vYJmANHeGWYGHIFFD1kGwAAoGilKDwMCAG1C9/N/2myFAAAAAElFTkSuQmCC",
"values": null,
"width": 16,
"label": "LayerGroup#1",
"contentType": "image/png",
"url": "http://localhost:8091/iserver/manager/static/Theme/image/layerGroup.png",
"height": 16
}],
"maxScale": 0,
"layerName": "LayerGroup#1",
"minScale": 0
},
{
"subLayerLegends": null,
"layerType": "UGC",
"legends": [{
"imageData": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAJUlEQVQ4jWNMS0v7z0ABYAERPT0hZBvARIntowaMGjBqABUNAACQNAO/KgaADgAAAABJRU5ErkJggg==",
"values": null,
"width": 16,
"label": "[email protected]",
"contentType": "image/png",
"url": "http://localhost:8091/iserver/output/resources/testcountries/SYMBOLFILL/0_858832806.png",
"height": 16
}],
"maxScale": 0,
"layerName": "[email protected]",
"minScale": 0
}
],
"layerType": "UGC",
"legends": [{
"imageData": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAVElEQVR42mNgGBRA3rP2CBD/x4LPKLtVyxJjwH88+D4QG1JiABquO0yhAbVHcBog51lrTW4ggg0gEKC4vYJmANHeGWYGHIFFD1kGwAAoGilKDwMCAG1C9/N/2myFAAAAAElFTkSuQmCC",
"values": null,
"width": 16,
"label": "LayerGroup",
"contentType": "image/png",
"url": "http://localhost:8091/iserver/manager/static/Theme/image/layerGroup.png",
"height": 16
}],
"maxScale": 0,
"layerName": "LayerGroup",
"minScale": 0
}]}Through the request, we got the json Format content , Now, let's introduce in detail what each parameter means . among url The parameter is the legend image we need to use .
Response Schema: application/json
{
layerLegends //Array of object Legend information of each layer
Array [
layerName //string Layer Name
layerType //string The layer type
minScale //number Layer minimum visible scale
maxScale //number Layer maximum visible scale
legends //Array of object Each legend item information of the layer
Array [
label //string Legend label
imageData //string Legend picture content base64 Express .
url //string Legend picture url
contentType //string Type of legend picture , Only for now png
width //string The width of the legend picture , Default 16 Pixels
height //string The height of the legend picture , Default 16 Pixels
values //object If it is a segmented thematic map ,values={start:startValue,end:endValue}, The default segment range is [start,end); If it is a single value thematic map ,values={unique:uniqueValue}
]
subLayerLegends LayerLegend[] // Legend of each sublayer .subLayerLegends The type is LayerLegend[].
]
}So in other cases , How to customize the request header method to obtain the legend information that meets the conditions ? According to the help documentation , adopt “mapLegend” Resources represent the collection of legend information of each layer of the map to obtain the legend information of each layer of the map .
path Parameters( Path parameter ) | mapname ( Required )(string) | Map name |
query Parameters( Request parameters ) | bbox (string) | Query the legend of the layer that intersects with this rectangle , When layers When the parameter is not set ,bbox Is a required parameter . Format :bbox=xmin,ymin,xmax,ymax |
layers (string) | Layer filtering , When bbox When the parameter is not set ,layers Is a required parameter . grammar :layers=[show|hide]:[layerName]@@[layerGroupName]@@[mapName].show Indicates that only the legend of the specified layer is returned ,hide Indicates that the specified layer legend does not return , Other queried layer legends are returned . Support multiple layers , The layers are separated by commas . Such as show:[email protected]@@World, To return only World Map [email protected] Legend for layer . | |
transparent (boolean) | Whether the background of the legend image is transparent . The default is true. | |
returnVisibleOnly (boolean) | Whether to return only the legend of the visible features within the current map range . The default is false. | |
mapScale (number) | Map scale . When returnVisibleOnly by true when ,mapScale Is a required parameter . | |
width (integer) | Returns the width of the legend . Default 16 Pixels . | |
| height (integer) | Returns the height of the legend . Default 16 Pixels . |
Request parameters through the above request header , We can customize the request content , To return the legend information that meets the custom requirements , For example, here we return to the specified layer "world" and "LayerGroup#1 Medium Countries" Two legends for , Then the content of the request header should be like this :
among “[email protected]@@[email protected]@testcountries” and “[email protected]@@[email protected]@[email protected]@testcountries” For the contents of the map sublayer set , We can pass in "layers" Object , By customizing “layers” object , We can get the legend information of the specified layer set , The results are as follows :
3、 ... and 、 matters needing attention
What should be paid attention to during the use of the legend :
1、 stay 11i beta In the previous version , We can also use the layers Object to get the legend of a single layer , Such as :http://localhost:8091/iserver/services/map-testmap/rest/maps/testworld/layers/[email protected]@@[email protected]@[email protected]@testworld/legend, among “[email protected]@@[email protected]@[email protected]@testworld” Name the layer , However, only one legend can be obtained at a time , And for the thematic map layer, the legend of a specific value or range cannot be obtained ;
2、 For the legend , Only the legend object of the map service published in the workspace has content , Because the legend information is saved in the map , For the map service of tile Publishing , Its legend is empty ;
3、 In the layer legend list , The display order and level of each legend are the same as that of the map iDesktop In the layer manager , If there is a problem with the display , Please update iServer To the latest version .
边栏推荐
- 两批次纯牛奶不合格?麦趣尔回应:正对产品大批量排查抽检
- A new journey of the smart court, paperless office, escorting the green trial of the smart court
- 爱可可AI前沿推介(6.30)
- Inner join and outer join of MySQL tables
- The format of RTSP address of each manufacturer is as follows:
- 通过EF Core框架根据SQL Server数据库表生成实体类
- 90.(cesium篇)cesium高度监听事件
- [leetcode] 15. Sum of three numbers
- Construction de la plate - forme universelle haisi 3559: obtenir le codage après modification du cadre de données
- Statistics on the number of closed Islands
猜你喜欢
随机推荐
使用Power Designer工具构建数据库模型
R language ggplot2 visualization: gganimate package is based on Transition_ The time function creates a dynamic scatter graph animation (GIF), and uses the labs function to add a dynamic time title to
[cf] 803 div2 A. XOR Mixup
Substrate 源码追新导读: 5月中旬: Uniques NFT模块和Nomination Pool
Redis的配置文件及新数据类型
Inner join and outer join of MySQL tables
SuperMap iClient3D for WebGL 加载TMS瓦片
Getting started with the go language is simple: go handles XML files
Some commonly used hardware information of the server (constantly updated)
A high precision positioning approach for category support components with multiscale difference reading notes
Hisilicon 3559 developing common sense reserves: a complete explanation of related terms
Getting started with the go language is simple: go handles XML files
When building the second website with pagoda, the website always reports an error: no input file specified
ES6新特性介绍
两批次纯牛奶不合格?麦趣尔回应:正对产品大批量排查抽检
200. 岛屿数量
MATLAB中polarplot函数使用
剑指 Offer 05. 替换空格: 把字符串 s 中的每个空格替换成“%20“
立创 EDA #学习笔记10# | 常用连接器元器件识别 和 无源蜂鸣器驱动电路
实现多方数据安全共享,解决普惠金融信息不对称难题


![[leetcode] 15. Sum of three numbers](/img/0c/4363d7737d90c170eb4519828990b9.png)





