Beispiel #1
0
        private InMemoryFeatureLayer GetWellDepthPointLayer()
        {
            //Create an in memory layer to hold the well data from the text file
            InMemoryFeatureLayer inMemoryFeatureLayer = new InMemoryFeatureLayer();

            inMemoryFeatureLayer.FeatureSource.Open();
            //Make sure to specify the depth column
            inMemoryFeatureLayer.Columns.Add(new FeatureSourceColumn("Depth", "String", 10));

            //Loop through all the point data and add it to the in memory layer
            foreach (KeyValuePair <PointShape, double> wellDepth in wellDepthPointData)
            {
                Feature feature = new Feature(wellDepth.Key);
                feature.ColumnValues.Add("Depth", wellDepth.Value.ToString());
                inMemoryFeatureLayer.InternalFeatures.Add(feature);
            }
            //Now that all of the data is added we can build an in memory index to make the lookups fast
            inMemoryFeatureLayer.BuildIndex();

            //Create the well point style
            PointStyle pointStyle1 = PointStyles.CreateSimpleCircleStyle(GeoColor.StandardColors.White, 4, GeoColor.SimpleColors.Black, 2);

            inMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(pointStyle1);

            //Create the text style with a halo
            TextStyle textStyle = TextStyles.CreateSimpleTextStyle("Depth", "Arial", 10, DrawingFontStyles.Regular, GeoColor.SimpleColors.Black);

            textStyle.HaloPen        = new GeoPen(GeoColor.StandardColors.White, 3);
            textStyle.PointPlacement = PointPlacement.UpperCenter;
            textStyle.YOffsetInPixel = 5;

            //Apply these styles at all levels and add then to the custom styles for the layer
            inMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
            inMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(textStyle);

            return(inMemoryFeatureLayer);
        }