Recently we have noticed that our app doesn't display labels for layers build as line shapefiles. There are some labels, but waaaay too few, and in most cases none show up at all. I'd post a sample app, but the shapefile itself that I would need to include is bigger than 250k limit. Needless to say the same shapefile displays properly in our old app that doesn't use ThinkGeo engine, proving that data is not missing. The fact that _some_ labels do show up also proves that the code does access the data in the shapefile too. Yet somehow not enough labels show up.
Here is my code:
public partial class _Default : System.Web.UI.Page
{
private LayerOverlay layerOverlayX;
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
mapMain.MapBackground.BackgroundBrush = new GeoSolidBrush(GeoColor.FromHtml("#B3C6D4"));
CreateOverlay();
mapMain.MapUnit = GeographyUnit.DecimalDegree;
}
}
void CreateOverlay()
{
layerOverlayX = new LayerOverlay("base", true, TileType.MultipleTile);
layerOverlayX.ClientCache = new ClientCache();
mapMain.CustomOverlays.Add(layerOverlayX);
CreateShapeLineLayer("roads", MapPath("~/Data/interstates.shp"),
LineStyles.Interstate1, TextStyles.Interstate1("ROUTE_NUM"));
}
void CreateShapeLineLayer(string strName, string strShapeFileName, LineStyle styleLine, TextStyle styleText)
{
ShapeFileFeatureLayer tempLayer = new ShapeFileFeatureLayer(strShapeFileName);
tempLayer.Name = strName;
tempLayer.RequireIndex = false;
ZoomLevel zlevelBase = tempLayer.ZoomLevelSet.ZoomLevel01;
zlevelBase.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
zlevelBase.DefaultLineStyle = styleLine;
zlevelBase.DefaultTextStyle = styleText;
layerOverlayX.Layers.Add(tempLayer);
}
}