I am showing a KML layer on our map, that includes lines and text. When I look at the layer in Google Earth, the text is on top of the lines, and can be read easily. When I show the layer on our map, the lines are on top of the text, and is harder to read. Is there a property or something I can adjust to get the text to draw over the lines? Also, the code builds an .idx file for the KML file if there isn’t one.
Here is the code the loads the layer:
Dim kmlLayer As New KmlFeatureLayer(fileName)
kmlLayer.FeatureSource.Projection = proj4
kmlLayer.ZoomLevelSet.ZoomLevel04.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20
kmlLayer.IsVisible = True
kmlLayer.Transparency = 255
kmlLayer.Name = layerName
kmlLayer.DrawingQuality = DrawingQuality.HighQuality
stormOverlay.Layers.Add(kmlLayer.Name, kmlLayer)
I don’t see the text style settings anywhere to try them out. If I set the StylingType to StandardStyling, the layer does not show on the map.
I was wondering about the order that the MapShapes are in. It looks like the time labels are added first to the mapShape collection (indexes 0 - 32), and the lines (as lineStrings) are all added after them (indexes 33-44). Are the shapes drawn in the order they are in in the MapShapes collection? Can I change the order in code?
Dim kk As New Collection(Of MapShape)
kk = kmlLayer.GetAllMapShapes(fileName)
So I got it to work by rewriting the KML layer in code, and moving the label items to the end of the KML file. That way the line shapes are drawn first, as they are now the first shapes in the KML file, and the label shapes are drawn after them.
Is there some sort of draw order property that would have done this? Something like .DrawOrder = FirstToLast or LastToFirst?
We don’t have a property like the DrawOrder you mentioned.
If you set StylingType to StandardStyling, you should want to set the default style to ZoomLevel just like any other layer in our map. If you don’t set it, that means the shape don’t have its style, so the map will be empty.