Create circle after loading of a div.

2910
2
12-03-2015 05:47 AM
ADITYAKUMAR1
Occasional Contributor III

Hi Users,

i am creating a circle on the map with the following lines of code.

   map.on("click", function (e) {

                  map.graphics.clear();

                  var circle = new Circle({

                      center: e.mapPoint,

                      radius: 1000,

                      radiusUnit: Units.MILES

                  });

                  var pictureMarkerSymbol = new PictureMarkerSymbol('Images/Bufferpin.png', 25, 25);

                  var point = new Point(e.mapPoint);

                  var pointGraphic = new Graphic(point, pictureMarkerSymbol);

                  map.graphics.add(pointGraphic);

                  // figure out which symbol to use   

                  map.graphics.add(new Graphic(circle, fillSymbol));

                  map.setExtent(graphicsUtils.graphicsExtent(map.graphics.graphics));

                  queryMapService(circle);

              });

But I need to perform the event after loading of a div where I will assign the units and radius length.

I have a button, on click of which a div opens where user can enter length and units and then on click on map the circle comes on the map.

Any suggestion in this will be helpful.

Thanks

Aditya Kumar

Tags (2)
0 Kudos
2 Replies
thejuskambi
Occasional Contributor III

Hello Aditya,

You can setup the map.onclick event online when the other inputs are filled.

or

you can have a variable which checks if that required value is present and if not then just escape from the click event without doing any thing.

Hope this was helpful.

Thejus

ADITYAKUMAR1
Occasional Contributor III

Hi Tehus,

Thanks for the response. But I do have other functionality like query,find where also a div comes on click of a button as well and in terms of validation anyway I need to ask the user to enter the value.

0 Kudos