ThinkGeo.com    |     Documentation    |     Premium Support

Label ordering of features

Is there any location/wiki that details the setting differences for Overlays, with respect to showing feature labels?

Scenario:

We have one overlay for all point-based layers, one for line-based, and one for polygon-based. We want to have feature labels, if turned on, to display.

It’s not clear how the ordering is determined. It seems that depending on the TileType/RenderMode/DrawingQuality settings of the overlay, it’ll default to display labels. Other times, it requires refreshing a layer before labels will display, even if the labels were set to visible when first added.

I guess this is a long-winded way of asking, what default overlay settings should be used for the fastest drawing/rendering performance while still defaulting to drawing labels/not covered by filled polygons?

Thanks Fred,
We recommend put the data which won’t change for long time to one overlay. This way we could enable to cache for this overlay. and the mapsuite won’t draw it every time.This will get better performance. In the overlay. we recommend add the polygon layer first then line and point. Because the polygon may not transparent we always want it in the bottom. For the label we won’t add a separate layer for the label. We use the TextStyle to display the field in the layer. If you want to hide the label. I would like add the a separate overlay. In this overlay add your layer with TextStyle.

If you have any more concerns you could always post some sample code. That will be very helpful for us look into more detail and give you more suggestion.

Thanks

Frank

Right now, we add a base set of overlays based on type to the map:

        overlays.Add(linesOverlay);
        overlays.Add(pointsOverlay);
        overlays.Add(nauticalChartsOverlay);
        overlays.Add(polygonsOverlay);

Then, the user will select a bunch of tables from an Access DB, and it’ll add to each selected layer to the respective overlay depending on type:

  switch(layerType)
 {
        case ShapeFileType.Point:
            overlays["PointsOverlay"].Layers.Add(newLayer.Name,newLayer);
        case ShapeFileType.PolyLine:
            overlays["LinesOverlay"].Layers.Add(newLayer.Name,newLayer);
        case ShapeFileType.Polygon:
            overlays["PolygonsOverlay"].Layers.Add(newLayer.Name,newLayer);
 }

Does the order of overlays make a difference? Should there not be separate overlays for each shapefiletype? Does the order of layers added matter? Thanks.

Thanks Fred,
For the overlays. I prefer add the polygon first. then the line and point.

    overlays.Add(polygonsOverlay);
    overlays.Add(nauticalChartsOverlay);
    overlays.Add(linesOverlay);
    overlays.Add(pointsOverlay);

No, The order of the overlays won’t change. The order of the overlays will be determined when you doing overlays.Add. The first one to be added will be in the bottom of the map.

What you current doing is correct. But you need know when you do overlays[“PolygonsOverlay”].Layers.Add(newLayer.Name,newLayer); The newlayer should be transparent otherwise this new polygon layer may cover the previous polygon layers.

Yes. The first added will be at the bottom of the overlay.

Conclusion:

Here is how we organize the overlay and the layers. You don’t need too worry about the line and the points. Because it won’t cover each other. But the polygon has the area style. it may cover another polygon layer. so you need a transparent area style for the none-bottom polygon layer.

Thanks

Frank