I want to provide “world units” as a size for some of my TextStyles.
Right now, all my TextStyle sizes are in pixels, so the size of the text doesn’t change regardless of the zoom level. However, I would like to give the user the option of setting the units as nautical miles, degrees, meters, etc. where the size value is that many units. For example, a size of 5 and a unit of “Nautical Mile” would make the text appear as big as 5 nautical miles on the map.
This would be useful for labeling oceans, continents, etc.
So the text should get smaller as I zoom out, and bigger as I zoom in.
Below is an example from a different mapping app. The text unit is set to Nautical Miles, with a size of 10. As you can see, zooming in closer makes the text bigger. I then use the measure tool to confirm the size of the text. It shows ~10 nautical miles (the red text; easier to see if you open the .gif in a new window).
I messed around a bit with the older ScalingTextStyle project on the samples page, but can’t get it working properly from there. Any help would be great! Thanks!