dojox.gfx

How to debug javascript file that is using dojo library

Hi Everybody,

I am new to the javascript and dojo. Can anybody tell me how to debug the javascript file that is included dojo libraries using dojo.require statements. I tried debugging but i am getting error "dojo undefined". Please help me out what is the issue. This error is popped up in IE6.

I am sorry if the question is irrelevant

Thanks in advance
dojoguy

Text and event handling using dojox.gfx

Hi everybody,

I have the following questions

1)Can anybody tell me how to place text at the center of a polygon. The text should be fit with in the polygon boundary without resizing the polygon.

2) I have set of polygons and by hovering a mouse over a apolygon should change it's color. How can i achieve that. I tried attaching a onmouseover event to polygon but it's always changing the color of a polygon that is rendered last.

Here is the code that is used for drawing text at the center of a polygon and attaching events to a shape.

var polyLine= ctx.createPolyline(points); // points is anarray populated withthe points from database
polyLine.setFill("red");
polyLine.setStroke({ color: "blue", width: 1 });
polyLine.setTransform([{ dx: 500, dy: 100 }, m.scale(3)]);

polyLine.connect("onmouseover", function(){polyLine.setFill("blue");});
polyLine.connect("onmouseout", function(){polyLine.setFill("red");});
polyLine.connect("onclick", function(){alert("load some other page");});

var bBox= polyLine.getBoundingBox();
var centerX = (bBox.x + bBox.width)/2.0;
var centerY = (bBox.y + bBox.height)/2.0;

var text = makeText(ctx, {x: centerX, y: centerY, text: "name of polygon"}, {family: "Times", size: "6pt"}, "black", "red");
text.setTransform([{ dx: 500, dy: 100 }, m.scale(3)]);

this functionality is very much needed for my widjet application. appreciate any help

Thanks in advance
dojoguy

Text and event handling using dojox.gfx

Hi everybody,

I have the following questions

1)Can anybody tell me how to place text at the center of a polygon. The text should be fit with in the polygon boundary without resizing the polygon.

2) I have set of polygons and by hovering a mouse over a apolygon should change it's color. How can i achieve that. I tried attaching a onmouseover event to polygon but it's always changing the color of a polygon that is rendered last.

Here is the code that is used for drawing text at the center of a polygon and attaching events to a shape.

var polyLine= ctx.createPolyline(points); // points is anarray populated withthe points from database
polyLine.setFill("red");
polyLine.setStroke({ color: "blue", width: 1 });
polyLine.setTransform([{ dx: 500, dy: 100 }, m.scale(3)]);

polyLine.connect("onmouseover", function(){polyLine.setFill("blue");});
polyLine.connect("onmouseout", function(){polyLine.setFill("red");});
polyLine.connect("onclick", function(){alert("load some other page");});

var bBox= polyLine.getBoundingBox();
var centerX = (bBox.x + bBox.width)/2.0;
var centerY = (bBox.y + bBox.height)/2.0;

var text = makeText(ctx, {x: centerX, y: centerY, text: "name of polygon"}, {family: "Times", size: "6pt"}, "black", "red");
text.setTransform([{ dx: 500, dy: 100 }, m.scale(3)]);

this functionality is very much needed for my widjet application. appreciate any help

Thanks in advance
dojoguy

Syndicate content

Back to top