The maxDisplacement vendor option works well for separating two labels which are both being rendered at the centre of the image (e.g. due to the map extent being wholly inside both polygons). Actually I needed to use spaceAround as well, to provide some separation between the two labels.
The problem is that in our application there client-side point feature layers, with icons being rendered client-side (by Leaflet). When the map is zoomed to one of the client-side point features, the icon obscures the label underneath it. And actually a bigger concern is that the map area around the icon is obscured by the label behind it. We might be able to remedy this by forcing the zoom function to move the map so the feature location is above or below the centre of the map extent. But it seems cleaner and more versatile to force the underlying labels away from the map centre. Perhaps the general requirement here is to have more control over where labels are placed in map image space, for the case of large "regional" polygon features (which are often rendered at a scale where the map extent is inside the polygon). The SLD Displacement parameter is one way to control this. I could imagine a more sophisticated layout control allowing labels to be anchored relative to the map extent box, as well. On Tue, Dec 11, 2018 at 11:05 AM Andrea Aime <[email protected]> wrote: > On Tue, Dec 11, 2018 at 7:41 PM Martin Davis <[email protected]> wrote: > >> Thanks for the assistance. >> >> I will look into logging an issue for this. >> >> For the record, the use cases for this capability are: >> - In the case where there are two polygonal coverage layers containing >> large jurisdiction boundary polygons, when zoomed far in (so that the map >> extent is fully inside the polygons), the polygon labels are both at the >> centre of the map image and one is obscured. By offsetting the labels up >> and down the goal is to show both >> - On a web map where the client displays point features with clients-side >> icons, when the map is zoomed to a point feature, the icon is displayed in >> the centre of the map extent, and obscures the jurisdiction polygon >> label(s) underneath it. Goal is to make the label visible by offsetting it. >> > > Why use a static displacement, the maxDisplacement vendor option should > let GeoServer apply a suitable offset for you > in case the target location is already busy? > > Cheers > Andrea > > == > > GeoServer Professional Services from the experts! Visit > http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf > Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa > (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 > http://www.geo-solutions.it http://twitter.com/geosolutions_it > ------------------------------------------------------- *Con riferimento > alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - > Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni > circostanza inerente alla presente email (il suo contenuto, gli eventuali > allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i > destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per > errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le > sarei comunque grato se potesse darmene notizia. This email is intended > only for the person or entity to which it is addressed and may contain > information that is privileged, confidential or otherwise protected from > disclosure. We remind that - as provided by European Regulation 2016/679 > “GDPR” - copying, dissemination or use of this e-mail or the information > herein by anyone other than the intended recipient is prohibited. If you > have received this email by mistake, please notify us immediately by > telephone or e-mail.* >
_______________________________________________ Geoserver-users mailing list Please make sure you read the following two resources before posting to this list: - Earning your support instead of buying it, but Ian Turton: http://www.ianturton.com/talks/foss4g.html#/ - The GeoServer user list posting guidelines: http://geoserver.org/comm/userlist-guidelines.html If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-users
