I use a custom base map from a TIFF file and then overlay it with a couple of layers that are SHP_POINT shape files. The shape files are not rendering, but if I do a ZoomToMaxVisibleExtents() on the layer it will correctly zoom to the extents of the objects in the shape file for the layer even though I cannot see them. Any help would be hugely appreciated! I'd hate to have to fall back to 4.8 since this has many nice new features!
Shapefile sf = new Shapefile();
sf.CreateNewWithShapeID("", ShpfileType.SHP_POINT);
// Add Name attribute
sf.StartEditingShapes(true, null);
Field name = new Field() { Name = "Name", Type = FieldType.STRING_FIELD, Width = 20 };
int nameIndex = sf.NumFields;
sf.EditInsertField(name, ref nameIndex, null);
sf.StopEditingShapes(true, true, null);
// creating points and inserting them in the shape
sf.StartEditingShapes(false, null);
foreach (MapEquipmentDef well in layerDef.Equipment.Values)
{
MapWinGIS.Point pnt = new MapWinGIS.Point() { x = well.X, y = well.Y };
Shape shp = new Shape();
shp.Create(ShpfileType.SHP_POINT);
int index = 0;
shp.InsertPoint(pnt, ref index);
int shpIndex = sf.NumShapes;
sf.EditInsertShape(shp, ref shpIndex);
sf.EditCellValue(nameIndex, shpIndex, well.DisplayName);
well.LayerIdx = axMap1.NumLayers;
well.ShapeIdx = shpIndex;
}
sf.Labels.Alignment = tkLabelAlignment.laBottomCenter;
sf.Labels.AutoOffset = true;
sf.Labels.AvoidCollisions = true;
sf.Labels.FontBold = true;
sf.Labels.FontSize = 9;
sf.Labels.FontColor = Convert.ToUInt32(ColorTranslator.ToOle(layerDef.LabelColor));
sf.Labels.FrameVisible = false;
sf.GenerateLabels(nameIndex, tkLabelPositioning.lpCenter, false);
sf.StopEditingShapes(true, true, null);
sf.DefaultDrawingOptions.SetDefaultPointSymbol(layerDef.Symbol);
sf.DefaultDrawingOptions.PointSize = layerDef.SymbolSize;
sf.DefaultDrawingOptions.LineColor = Convert.ToUInt32(ColorTranslator.ToOle(Color.Black));
sf.DefaultDrawingOptions.FillColor = Convert.ToUInt32(ColorTranslator.ToOle(layerDef.SymbolColor));
sf.FastMode = true;
// adds shapefile to the map
layerDef.LayerIdx = axMap1.AddLayer(sf, true);
axMap1.set_LayerName(layerDef.LayerIdx, layerDef.LayerName);
axMap1.set_LayerVisible(layerDef.LayerIdx, true);