Is it possible to have a label for a polygon try to stay within the polygon at all times? Currently, when zoomed out enough so that the polygon is fully visible, the label will be in the center. If I start zooming in/panning so only part of the polygon is visible, I want the label to “move” to try and fit within the polygon.
Polygon labeling options
Did you have a chance to try TextStyle.FittingPolygonInScreen? Here is the documentation of it:
Hi Ben, so I did try that but it seems to make duplicate labels for the polygon when I set that to true. For example, look at this red polygon:
I am zoomed in so half of it is cut off. That “20” is the label, and for some reason it shows it twice when I set FittingPolygonInScreen to true.
Hi Dan,
It works find for me. the “20” at the top in your screenshot seems a bit smaller than the one below, any chance they are from different data or from different style?
If you still have the issue, can you send your code/data to us? You can either upload it here or send to support@thinkgeo.com.
Thanks,
Ben