Hello.
I can draw polygon with below code
scketchViewModel.create("polygon");
I want to draw rectangle and circle with cketchViewModel tried below codes but it seems doesn't working
scketchViewModel.create("rectangle");
scketchViewModel.create("circle");
What i'm doing wrong. Is there a sample code if rectangle and circle drawing is totally different from polygon.
Thanks inadvance.
Can you post more of your code? The SketchViewModel sample shows that syntax for creating rectangles and circles working correctly.
// ***************************************
// activate the sketch to create a rectangle
// ***************************************
var drawRectangleButton = document.getElementById("rectangleButton");
drawRectangleButton.onclick = function() {
// set the sketch to create a polygon geometry
sketchViewModel.create("rectangle");
setActiveButton(this);
};
// ***************************************
// activate the sketch to create a circle
// ***************************************
var drawCircleButton = document.getElementById("circleButton");
drawCircleButton.onclick = function() {
// set the sketch to create a polygon geometry
sketchViewModel.create("circle");
setActiveButton(this);
};
Hello Ken. thanks for reply,
I found my code was wrong. I missed a "#" when i getting button id with jquery.
my problem solved now.
Best regards.