geoserver動(dòng)態(tài)顏色參數(shù)樣式、動(dòng)態(tài)sql配置實(shí)現(xiàn)

geoserver動(dòng)態(tài)顏色參數(shù)樣式、動(dòng)態(tài)sql配置實(shí)現(xiàn)

動(dòng)態(tài)顏色參數(shù)樣式、動(dòng)態(tài)sql

訪問方式:

http://localhost:20011/geoserver/gzzjygis/wms?service=WMS&version=1.1.0&request=GetMap&layers=layername&bbox=103.804856%2C24.869804%2C109.336088%2C29.12673&width=768&height=591&srs=EPSG%3A4326&format=application/openlayers&viewparams=paramcolor:00ff00;type:A



樣式設(shè)置:

<?xml version="1.0"encoding="UTF-8"?>

xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd"

xmlns="http://www.opengis.net/sld"

xmlns:ogc="http://www.opengis.net/ogc"

xmlns:xlink="http://www.w3.org/1999/xlink"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<!-- a Named Layer is the basic building block of an SLD document -->

default_point

<!-- Styles can have names, titles and abstracts -->

Default Point

A sample style that draws a point

<!-- FeatureTypeStyles describe how to render different features -->

<!-- A FeatureTypeStyle for rendering points -->

rule1

Red Square

A 6 pixel square with a red fill and no stroke

circle

paramcolor

6

視圖sql設(shè)置:

select? dataid, dataname,d.the_geom,'#%paramcolor%' as paramcolor from d

where apt_code ='%type%'

提取 paramcolor和type為動(dòng)態(tài)參數(shù)

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

友情鏈接更多精彩內(nèi)容