Thursday, 26 February 2015

openlayers 2 - Showing Two Labels of One feature In GeoServer?


I have prepared a Web GIS Map using Geoserver-Openlayers_Postgis....For One Feature I need to show two labels such as "premise_no' & "bld_name'... The following is the xml I used for styling(in geoserver).... But it is showing either/or labels...


xml for layer styling(in geoserver)....










v_building_ar


group 0

Feature
generic:geometry
simple

1
1.0
2000.0


#FF8000

round
0.05




prem_no


Arial

8.0
normal
normal




0.0
0.0



0.0
0.0




#000000





bldname


Arial
8.0
normal
normal





0.0
0.0


0.0
0.5





#000000









Answer



The label placement algorithm will almost certainly decide not to show both labels as they will overlap. There are various vendor options that you can use to make it less picky about overlaps and clutter but it will end up looking ugly.


The better solution is to combine the two properties into one label (this will give you much more control over the way they line up etc. too). See the user guide for full details but try something like:



prem_no, bldname

No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...