0

I am new to ArcGIS javascript api and I have created a map which allows users to draw circle geometries. I just want to limit the functionality so that the radius is specified at 10000km.

This is the code at the moment:

$('#circle').click(function () {
        clearPreviousSearch();
        map.disableMapNavigation();
        $('#run').fadeOut();
        buttonclickvalue = 'circle';
        drawToolbar.activate(esri.toolbars.Draw.CIRCLE);

    });

And I've amended it to this:

$('#circle').click(function (e) {
        var radius = map.extent.getWidth() / 10;
        radius : radius
        clearPreviousSearch();
        map.disableMapNavigation();
        $('#run').fadeOut();
        buttonclickvalue = 'circle';
        drawToolbar.activate(esri.toolbars.Draw.CIRCLE);

    });

Can anyone possibly help/give me some pointers to try and remedy?

1

here is a sample script for drawing a cirlce on a specified radius.

var circleSymb = new SimpleFillSymbol(
        SimpleFillSymbol.STYLE_NULL,
        new SimpleLineSymbol(
        SimpleLineSymbol.STYLE_SHORTDASHDOTDOT,
        new Color([105, 105, 105]),
        2 
       ), new Color([255, 255, 0, 0.25])
      );
        var circle;

    //when the map is clicked create a buffer around the click point of the specified distance.       

    map.on("click", function(evt){ 
        circle = new Circle({
        center: evt.mapPoint,
        geodesic: true,
        radius: 5,
        radiusUnit: "esriMiles"
       });
          map.graphics.clear();
          map.infoWindow.hide();
          var graphic = new Graphic(circle, circleSymb);
          map.graphics.add(graphic);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.