How to create circle or buffer of 1 KM around specified waypoint in arcGIS JAVA SDK?

169 Views Asked by At

I'm using this code snippet to draw circle, Circle shape is fine but circle covers even thousand km during zoom-out. I need to fix this circle around specified radius.

     private void addPointGraphic(double lat, double lng, float radius) {
           
        if (graphicsOverlay != null) {
            Viewpoint viewpoint = new Viewpoint(latitude, longitude, 12);
            final ListenableFuture<Boolean> viewpointSetFuture = mapView.setViewpointAsync(viewpoint, 5);
            SimpleMarkerSymbol pointSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.Style.CIRCLE, color, radius);
            pointSymbol.setOutline(new SimpleLineSymbol(SimpleLineSymbol.Style.SOLID, hexGreen, 1.5f));
            Point point = new Point(lng, lat, SpatialReferences.getWgs84());

            Graphic pointGraphic = new Graphic(point, pointSymbol);
            graphicsOverlay.getGraphics().add(pointGraphic);
         
        }
    }
1

There are 1 best solutions below

0
On

The ArcGIS Runtime SDK for Java has many samples available for different workflows. Perhaps the Buffer sample suits what you are trying to do: https://github.com/Esri/arcgis-runtime-samples-java/tree/master/geometry/buffer

Esri's GeoNet forums also have dedicated message boards for all the SDKs, so any perticular questions regarding the Java SDK might get more visibility from that community there: https://community.esri.com/t5/arcgis-runtime-sdk-for-java/bd-p/arcgis-runtime-sdk-for-java-questions