ThinkGeo.com    |     Documentation    |     Premium Support

Override TextStyle DrawCore

MapSuite Team,

With your assistance in the past I’ve implemented an override of TextStyle DrawCore. This allows the text of the actual label to be altered prior to drawing. This works fine in all cases except for polygons where said polygon is not entirely contained wholly within the current extent.

In my example, shown below, the labels (in upper left & right as Zone1 & Zone2) first appear at ZoomLevel=12 and then continue to appear through ZoomLevel=01. The labels will not appear from ZoomLevel=13 to ZoomLevel=20.

If I do not override the TextStyle the labels appear at all ZoomLevels. The second screen shot below shows this example. The label appears simply as the number “2” in the center of the map.

I’ve set a breakpoint in my code and can see the label being changed ( changing a “2” to “Zone2”) and the DrawCore occurring, but the label does not appear.

These are the LabelTextStyle Properties:
LabelOverlappingRule=AllowOverlapping
LabelDuplicateRule=NoDuplicateLabels
DrawingLevel=LabelLevel
GridSize=1
FittingPolygonFactor=10
LabelAllPolygonParts=false
FittingPolygon=true
FittingPolygonInScreen=true

Would you offer guidance on what the issue might be?

Thanks,
Dennis

Hi Dennis,

It looks you have two questions:

  1. “Zone1” and “Zone2” don’t appear from level 13 to 20 after you set custom style.
  2. “Zone2” shows as “2” in some special zoomlevel.

If I misunderstand your question please let me know.

Have you tried to only show the “zone1” and “zone2” layer and see whether it still appear on from level 1 to 12? If it can be produced, please show us your custom layer code, so we can help you find the reason.

If that’s related with other layer, I think a simple project which can reproduce it should be helpful, I hadn’t found the problem in your setting listed here for LabelTextStyle.

Regards,

Don

Don,

I have found the issue. I had neglected to properly set the FittingPolygonInScreen Property. Now that it is set properly my modified labels appear as expected as shown in the screen shot below.

Sorry to have troubled you with this, but thank you for being a sounding-board.

Dennis

Hi Dennis,

I am glad to hear you find the problem and solved it.

And thanks for your share here, your update is also helpful for us.

Any question please let us know.

Regards,

Don