create 专题图层示例
符号配置
简单点符号
{
"style":{
"type":"simplemarker",
"shape":"ellipse", // ellipse 、rectangle、rhombus、triangle
"size":"10px", // mm、cm、px 不设置后缀单位时默认为像素
"color":{
"red":255,
"green":0,
"blue":0,
"alpha":255
},
outline:{
"width":"1px",
"color":{
"red":0,
"green":0,
"blue":255,
"alpha":255
}
}
}
}
简单线符号
{
"style":{
"type":"simpleline",
"penstyle":"solid", // solid,dash,dot,dashdot,dashdotdot
"width":"1px",
"color":{
"red":255,
"green":0,
"blue":0,
"alpha":255
}
}
}
简单面符号
{
"style":{
"type":"simplefill",
"color":{
"red":255,
"green":0,
"blue":0,
"alpha":255
},
"linestyle":{
"type":"simpleline",
"penstyle":"solid", // solid,dash,dot,dashdot,dashdotdot
"width":"1px",
"color":{
"red":255,
"green":0,
"blue":0,
"alpha":255
}
}
}
}
专题图配置
单一渲染
{
"theme":{
"type":"single",
"style":{
"type":"simplemarker",
"shape":"ellipse", // ellipse 、rectangle、rhombus、triangle
"size":"10px", // mm、cm、px 不设置后缀单位时默认为像素
"color":{
"red":255,
"green":0,
"blue":0,
"alpha":255
}
}
}
}
分段专题图
{
"theme":{
"type":"range",
"expression":"fieldname",
"items":[
{
"label":"label value",
"minvalue":1.1,
"maxvalue":5.6,
"style":{
"type":"simplefill",
"color":{
"red":255
}
}
},
{
"label":"label value",
"minvalue":1.6,
"maxvalue":10.6,
"style":{
"type":"simplefill",
"color":{
"green":255
}
}
}
]
}
}
四色专题图
{
"theme":{
"type":"fourColor",
"colors":[ // 指定四种颜色值
{
"red":255
},
{
"green":255
},
{
"blue":255
},
{
"red":100
}
]
}
}
饼图
{
"theme":{
"type":"pie",
"radius":"10px",
"items":[
{
"field":"fieldname1",
"color":{
"red":255
}
},
{
"field":"fieldname2",
"color":{
"green":255
}
}
]
}
}
直方图
{
"theme":{
"type":"histogram",
"width":"5px", // 柱图的宽
"height":"10px", // 主图的高
"items":[
{
"field":"fieldname1",
"color":{
"red":255
}
},
{
"field":"fieldname2",
"color":{
"green":255
}
}
]
}
}
堆叠图
{
"theme":{
"type":"stack",
"width":"5px",
"height":"10px";
"items":[
{
"field":"fieldname1",
"color":{
"red":255
}
},
{
"field":"fieldname2",
"color":{
"green":255
}
}
]
}
}
唯一值分类符号
{
"theme":{
"type":"unique",
"expression":"fieldname",
"items":[
{
"label":"label1",
"value":"1",
"visible":true, // option. 默认为true
"style":{
"type":"simplemarker"
}
},
{
"label":"label2",
"value":"2",
"visible":true, // option. 默认为true
"style":{
"type":"simplemarker"
}
}
]
}
}
分级符号
{
"theme":{
"type":"level",
"expression":"fieldname",
"level":3,
"method":"average",
"minsize":"4px",
"maxsize":"20px",
"style":{
"type":"simplemarker"
}
}
}
点密度图
{
"theme":{
"type":"dotdensity",
"dotsize":"2px", // 点大小
"dotvalue":10, // 点代表的大小
"items":[
{
"expression":"field1",
"color":{
"red":255,
"green":0,
"blue":0,
"alpha":255
}
},
{
"expression":"field2",
"color":{
"red":0,
"green":255,
"blue":0,
"alpha":255
}
}
]
}
}
格网聚合图
{
"theme":{
"type":"cluster",
"gridsize":"80px", // 格网大小
"colors":[
{
"red":255
},
{
"green":255
}
]
}
}
标签专题图
{
"theme":{
"type":"label",
"items":[
{},//label setting object
{...},//label setting object
{...} //label setting object
]
}
}
{
"content":"exp:[fld1]+'-'+[fld2]", // 简单模式: fld ,表达式模式: exp:[fld1]+[fld2]
"where":"dlbm='021'", // 可选
"style":{
"type":"text",
"font":{
"name":"宋体",
"size":20,
"color":"rgb(255,0,0)"
}
}
}
{
"style":{
"type":"text",
"font":{
"name":"宋体",
"size":20, // 单位磅
"color":"rgb(255,0,0)",
"bold":false, // 可选,默认false
"italic":false, // 可选, 默认false
"underline":false, // 可选, 默认false
"strikethrough":false, // 可选,默认false
"anchor":"center", // 可选,默认为center( 可使用的值:left-top right-top right-bottom left-bottom top right bottom left center)
},
"halo":{ // 可选,默认不使用描边
"width":"2px",
"color":"rgb(100,100,100)"
},
"background":{ // 可选,默认不使用背景
"color":"rgb(0,100,0)",
"margin":"2px"
}
}
}
修改于 2023-04-13 06:59:46