Geometry Methods

Extent Methods


               Extent extent = new Extent(
                   xmax: 4120960.074670904, 
                   xmin: -3412935.278412999, 
                   ymax: 8963926.222211033, 
                   ymin: 6049459.93475111);

               Extent centeredExtent = await GeometryEngine.CenterExtentAt(extent, new Point(_centerLong, _centerLat));
               

               Extent extent = new Extent(
                   xmax: 4120960.074670904, 
                   xmin: -3412935.278412999, 
                   ymax: 8963926.222211033, 
                   ymin: 6049459.93475111);

               Extent centeredExtent = await GeometryEngine.CenterExtentAt(extent, new Point(_centerLong, _centerLat));
               

Point Methods

JSON methods are avaible for all geometry types


               Point point = new Point(longitude: -117.08, latitude: 34.1);
               

               Point point = new Point(longitude: -117.08, latitude: 34.1);
               

PolyLine Methods


                       PolyLine polyline = new PolyLine(new[]
                       {
                           new MapPath(new MapPoint(11, 52),
                               new MapPoint(11.5, 53),
                               new MapPoint(12, 55),
                               new MapPoint(10, 55),
                               new MapPoint(10.5, 51),
                               new MapPoint(11, 56))
                       });
               

                       PolyLine polyline = new PolyLine(new[]
                       {
                           new MapPath(new MapPoint(11, 52),
                               new MapPoint(11.5, 53),
                               new MapPoint(12, 55),
                               new MapPoint(10, 55),
                               new MapPoint(10.5, 51),
                               new MapPoint(11, 56))
                       });
               

                       Polygon _polygon = new(new MapPath[]
                       {
                           new MapPath
                           {
                               new(8.4598, 48.5621),
                               new(1.6279, 59.3947),
                               new(20.0018, 42.6334),
                               new(-4.2473, 42.7392),
                               new(8.4598, 48.5621)
                           }
                       });
               

                       Polygon _polygon = new(new MapPath[]
                       {
                           new MapPath
                           {
                               new(8.4598, 48.5621),
                               new(1.6279, 59.3947),
                               new(20.0018, 42.6334),
                               new(-4.2473, 42.7392),
                               new(8.4598, 48.5621)
                           }
                       });
               

Polygon Methods


               Extent extent = new Extent(
                   xmax: 4120960.074670904, 
                   xmin: -3412935.278412999, 
                   ymax: 8963926.222211033, 
                   ymin: 6049459.93475111);
               

               Extent extent = new Extent(
                   xmax: 4120960.074670904, 
                   xmin: -3412935.278412999, 
                   ymax: 8963926.222211033, 
                   ymin: 6049459.93475111);
               
About this sample

This GeoBlazor sample, written in Blazor for .NET developers, demonstrates GeoBlazor's GeometryEngine service which exposes geometry-manipulation operations from the ArcGIS Maps SDK for JavaScript. The page is a documentation-style reference of geometry methods grouped into four sections: Extent Methods (center an extent at a point, expand an extent by a factor, and offset an extent by X/Y distance), Point Methods (serialize a Point to ArcGIS JSON and parse JSON back to a C# Point), Polyline Methods (add a path to an existing polyline and inspect the result), and Polygon Methods (similar add-ring operations on Polygon). Each section displays a syntax-highlighted C# code snippet alongside number inputs and a button that invokes the corresponding GeometryEngine method, then renders the resulting geometry's coordinates back into a read-only text field. The sample is intended to demonstrate how to perform geometry math in pure C# from a Blazor application without writing JavaScript.