private void OnShapeSelected(IdentifierNodeMetadata shape) { var shapes = _context.Map.IdentifiedShapes; shapes.Clear(); shapes.AddShape(shape.LayerHandle, shape.ShapeIndex); if (View.ZoomToShape) { _context.Map.ZoomToShape(shape.LayerHandle, shape.ShapeIndex); } else { _context.Map.Redraw(RedrawType.SkipDataLayers); } }
private void OnPixelSelected(IdentifierNodeMetadata pixel) { var shapes = _context.Map.IdentifiedShapes; shapes.Clear(); shapes.AddPixel(pixel.LayerHandle, pixel.RasterX, pixel.RasterY); if (View.ZoomToShape) { var img = _context.Map.GetImage(pixel.LayerHandle); if (img != null) { var bounds = img.GetPixelBounds(pixel.RasterX, pixel.RasterY); bounds = bounds.Inflate(bounds.Width * 10, bounds.Height * 10); _context.Map.ZoomToExtents(bounds); } } else { _context.Map.Redraw(RedrawType.SkipDataLayers); } }
private void OnLayerSelected(IdentifierNodeMetadata layer) { var shapes = _context.Map.IdentifiedShapes; shapes.Clear(); var items = View.GetLayerItems(layer.LayerHandle); foreach (var item in items) { switch (item.NodeType) { case IdentifierNodeType.Geometry: shapes.AddShape(item.LayerHandle, item.ShapeIndex); break; case IdentifierNodeType.Pixel: shapes.AddPixel(item.LayerHandle, item.RasterX, item.RasterY); break; } } _context.Map.Redraw(RedrawType.SkipDataLayers); }