Once again, I picked up the WebGIS development. Now the data is ready and the framework has been set up. It is just now the application development. You know the steps and methods for adding layers.
Step 1: Create your own namespace in geoserver. Namespace example:Uri: -- http://www.bizkaia.net/geoserver?prefix--biz. Select Save and apply on the left. Remember!
Step 2: Create a datastore. If the data is stored in postgis, you should select the postgis spatial database data source, enter host, port, user name, password,WKB enabled andDo not fill in anything in the loose bBox box. If there is something in it, clear it. Finally: Submit first, save and apply.
Step 3: Create featuretype. On the featuretype page, select new to view all the tables that store space data in your database. Select the expected table and click Generate. geoserver automatically generates Minx, miny, Maxx, and Maxy. Finally, submit, save, and apply. Remember, you need to save and apply again. The data source will be written to the configuration file only when you save and apply for the second time.
Each featuretype is logically a layer. To display this layer, you also need to write the SLD file. For details about the SLD file, see the geotools document or SLD specifications. After writing the SLD file, upload it to the style directory under the geoserver directory, and add the style on the geoserver Management page. Do not press apply.
This is what I generated today (only the map part is captured ). There are three layers: province, city, and provincial capital. You also need to try more complex layers.