I am upgrading from TG-10 to TG-14. The version of CheckOverlapping I was using in my CustomTextStyle class (inherits from TextStyle) has been deprecated and I cant’ seem to make the current version work. Here is the code:
Dim oQuadTree As New Quadtree(Of SimpleCandidate)
If CheckOverlapping(oLabelingCandidate, oCanvas, Me.Font, Me.XOffsetInPixel, Me.YOffsetInPixel, Me.RotationAngle, oQuadTree) Then
'***** It would overlap another label so don't add it.
Continue For
End If
I receive the following:
System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=ThinkGeo.Core
StackTrace:
at ThinkGeo.Core.PositionStyle.CheckOverlapping(LabelingCandidate labelingCandidate, GeoCanvas canvas, GeoFont font, Single xOffsetInPixel, Single yOffsetInPixel, Double rotationAngle, Quadtree`1 labelsInAllLayersIndex)
at ThinkGeo_14_Demo.CustomTextStyle.GetLabeledFeatures(Collection`1 oAllFeatures, GeoCanvas oCanvas, Collection`1 labelsInThisLayer, Collection`1 labelsInAllLayers) in C:\Users\ZipPa\source\repos\LabelTest\CustomTextStyle.vb:line 829
I may not be using it correctly as I have never used QuadTree(of T) before. I have attached a sample project. Look in class CustomTextStyle in method GetLabeledFeatures for the exception.
Thanks,
Steve
LabelTest.zip (2.3 MB)