vendredi 30 janvier 2015

Define a circle extent using the circle tool - arcgis javascript api


I have the following script for drawing a circle and I want to limit the user to a predefined radius:



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


Where should I specify that I want to define the specific radius using the ArcGIS API script?:



var symbol = new SimpleFillSymbol().setColor(null).outline.setColor("blue");
var gl = new GraphicsLayer({ id: "circles" });
var geodesic = dom.byId("geodesic");
map.addLayer(gl);
map.on("click", function(e) {
var radius = map.extent.getWidth() / 100;
var circle = new Circle({
center: e.mapPoint,
geodesic: domAttr.get(geodesic, "checked"),
radius: radius
});


Any help or pointers appreciated!





Aucun commentaire:

Enregistrer un commentaire