doubDashQry.qry

  Download

More scripts: Style By Script

Syntax Highlighing:

comments, key words, predefined symbols, class members & methods, functions & classes
            
# DoubDashQry
# Line CartoScript to draw line as
# double dashes connected by crossing lines.
# Script from Using CartoScripts tutorial.
dashSize = 15;
halfDash = dashSize * 0.5;
double = 2 * dashSize;
offset = dashSize * 0.2;
doubOffset = offset * 2;
# Set line color and width
LineStyleSetColor(255,0,0);
LineStyleSetLineWidth(2);
# Draw double dash line and crossing lines
LineStyleMoveTo(90, offset);
LineStyleLineTo(0, dashSize);
LineStyleMoveTo(-90, doubOffset);
LineStyleLineTo(180, dashSize);
LineStyleMoveTo(0, halfDash);
LineStyleLineTo(90, doubOffset); 
while (LineStyleRoll(double) <> 1) {
	dist = LineStyleGetDistanceTo(3);
	if (dist > dashSize) {
		LineStyleMoveTo(90, offset);
		LineStyleLineTo(0, dashSize);
		LineStyleMoveTo(-90, doubOffset);
		LineStyleLineTo(180, dashSize);
		LineStyleMoveTo(0, halfDash);
		LineStyleLineTo(90, doubOffset);
		}
	}