当前位置:网站首页>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 .
边栏推荐
猜你喜欢

Understanding and learning of MySQL indexing and optimization

Set set

SuperMap iServer11i新功能----图例的发布和使用

List collection

MySQL索引和优化的理解学习

Introduction to new features of ES6

Hannaiping of Qilin software: the construction of Digital China needs its own open source root community

Talk about how to do hardware compatibility testing and quickly migrate to openeuler?

3D线光谱共焦传感器在半导体如何检测

Use of polarplot function in MATLAB
随机推荐
grep匹配查找
Understanding and learning of MySQL indexing and optimization
拆分电商系统为微服务
SuperMap iDesktop 常见倾斜数据处理全流程解析
剑指 Offer 05. 替换空格: 把字符串 s 中的每个空格替换成“%20“
What are the applications of 3D visual inspection in production flow
Redis - ziplist compressed list
Beego development blog system learning (II)
Use of redis in projects
A Generic Deep-Learning-Based Approach for Automated Surface Inspection-論文閱讀筆記
Substrate 源码追新导读: 5月中旬: Uniques NFT模块和Nomination Pool
The website with id 0 that was requested wasn‘t found. Verify the website and try again
Flutter 从零开始 007 输入框
Flutter 从零开始 006 单选开关和复选框
Embedded SIG | 多 OS 混合部署框架
HMS core audio editing service 3D audio technology helps create an immersive auditory feast
How do different types of variables compare with zero
90. (cesium chapter) cesium high level listening events
Set集合
QT MSVC installation and commissioning