private void btnBuffer_Click(object sender, EventArgs e) { InMemoryFeatureLayer inMemoryLayer = (InMemoryFeatureLayer)winformsMap1.FindFeatureLayer("InMemoryFeatureLayer"); InMemoryFeatureLayer bufferLayer = (InMemoryFeatureLayer)winformsMap1.FindFeatureLayer("BufferLayer"); AreaBaseShape baseShape = (AreaBaseShape)inMemoryLayer.InternalFeatures["POLYGON"].GetShape(); MultipolygonShape bufferedShape = baseShape.Buffer(100, 8, BufferCapType.Butt, GeographyUnit.DecimalDegree, DistanceUnit.Kilometer); Feature bufferFeature = new Feature(bufferedShape.GetWellKnownBinary(), "Buffer1"); bufferLayer.InternalFeatures.Clear(); bufferLayer.InternalFeatures.Add("BufferFeature", bufferFeature); winformsMap1.Refresh(winformsMap1.Overlays["BufferOverlay"]); }
public void BufferFeature(Map map, GeoCollection <object> args) { if (null != map) { InMemoryFeatureLayer mapShapeLayer = (InMemoryFeatureLayer)((LayerOverlay)(map.CustomOverlays["BufferLayerOverLayer"])).Layers["InMemoryFeatureLayer"]; InMemoryFeatureLayer bufferLayer = (InMemoryFeatureLayer)((LayerOverlay)(map.CustomOverlays["BufferLayerOverLayer"])).Layers["BufferLayer"]; AreaBaseShape baseShape = (AreaBaseShape)mapShapeLayer.InternalFeatures["POLYGON"].GetShape(); MultipolygonShape bufferedShape = baseShape.Buffer(1000, 8, BufferCapType.Round, GeographyUnit.DecimalDegree, DistanceUnit.Kilometer); Feature bufferFeature = new Feature(bufferedShape); bufferLayer.InternalFeatures.Clear(); bufferLayer.InternalFeatures.Add("BufferFeature", bufferFeature); ((LayerOverlay)(map.CustomOverlays["BufferLayerOverLayer"])).Redraw(); } }
private void BufferButtonClick(object sender, System.EventArgs e) { LayerOverlay bufferOverLay = (LayerOverlay)androidMap.Overlays["BufferOverlay"]; InMemoryFeatureLayer inMemoryLayer = (InMemoryFeatureLayer)bufferOverLay.Layers["InMemoryFeatureLayer"]; InMemoryFeatureLayer bufferLayer = (InMemoryFeatureLayer)bufferOverLay.Layers["BufferLayer"]; AreaBaseShape baseShape = (AreaBaseShape)inMemoryLayer.InternalFeatures["POLYGON"].GetShape(); MultipolygonShape bufferedShape = baseShape.Buffer(100, 8, BufferCapType.Butt, GeographyUnit.DecimalDegree, DistanceUnit.Kilometer); Feature bufferFeature = new Feature(bufferedShape.GetWellKnownBinary(), "Buffer1"); bufferLayer.InternalFeatures.Clear(); bufferLayer.InternalFeatures.Add("BufferFeature", bufferFeature); androidMap.Overlays["BufferOverlay"].Refresh(); }