Outside the question:
Since the change of work is very little time on the Internet, the new units do not let the Internet, so the blog has not been updated, although the quality of the post is generally like it, but think it is better to persist in writing, today, Beijing, rainy days, write some of the recent work in the income bar!
Overview:
The most recent work involves geoserver and openlayers content, this article summarizes some of the most common WMS operations involved in recent work for later use.
First, get the layer legend
The way the WMS service obtains the diagram is:
http://localhost:8080/geoserver/china/wms?request=getlegendgraphic&version=1.3.0&format=image/png& Layer=capital
Description
1. Request: The method must be getlegendgraphic;
2, the VERSION:WMS version, generally 1.1.0;
3, Format: formats, can be image/jpg,image/tif,image/png, etc., generally for image/png;
4, Layer: layers.
Effect:
Show effect
Legend effect
2, Cql_filter
Cql_filter is a condition-based display of a field, as follows:
Data table above, if you only need to show id>10 objects in the map, you can write this when you create a WMS layer:
var demolayer = new OpenLayers.Layer.WMS ("China", "http://localhost:8080/geoserver/china/wms", {layers: ' China: Capital ', Format: ' Image/png ', Cql_filter: "[id>10]"});
The results are shown below:
Before filtering
After filtering
The blog post will also be added and updated based on the content of the work.
WMS Common Operations