ThinkGeo.com    |     Documentation    |     Premium Support

TextStyle not drawing for some reason

I am having a weird issue. I have implemented a custom sized cluster style based on the cluster point style sample. I changed the logic behind the clustering and made it render the point symbol sized according to how many features were clustered in it. It also uses a text style to display the number of features contained within the cluster.

What I am running into is that sometimes the number just doesn’t display.I have verified that the column is valued but it’s just not displaying:

(there should be a 2 in that blank circle above the 10). I have tried to recreate this in a stand-alone example program but to no avail.

Any thoughts on what might be causing this?

Hi Jay,

It looks your shape and you label should be rendered at the same time, so I am not sure why the shape rendered by your custom logic but the label not.

I think you can modify the value of the Textstyle properties in you layer.

For example: DefaultTextStyle.DuplicateRule = LabelDuplicateRule.UnlimitedDuplicateLabels;

I am not sure whether that’s helpful, because there isn’t a sample can test, but I think you can try it.

Regards,

Don

Hi Don, thanks for the reply. I already had the TextStyle’s DuplicateRule set to Unlimited, so that didn’t help.

One thing I’ve been exploring is having the canvas passed into DrawCore draw the text directly using DrawTextWithWorldCoordinates rather than have the TextStyle do it. This seems to be working fine, but are there any downsides to doing this?

Hi Jay,

For text style, we add many validation and logic, sometimes they have a default value and maybe not under your control, so I think directly draw on Canvas is the best solution if you want they always be rendered on map.

I don’t think it have any problem, only it cannot get handled together if you have other layer which use text style.

But I think that’s not a problem for your scenario here.

Regards,

Don