Infrastructure Map Server Developer

Infrastructure Map Server Developer

Reply
Member
juebill
Posts: 3
Registered: ‎02-09-2005
Message 1 of 1 (35 Views)

Redlining a polyline

35 Views, 0 Replies
01-12-2006 02:36 AM
I am trying to redline a polyline

When I run the procedure I am getting an error message saying that there aren't the correct number of points.

Can anybody tell me what I need to do to correct this

function TROs_onDigitizedPolyline (map, numPoints, points)
{

// Create Redlining layer if it doesn't exist
redlineLayer = map.getMapLayer("Route");
if (redlineLayer == null) {
map.createLayer("redline", "Route");
redlineLayer = map.getMapLayer("Route");
redlineLayer.setShowInLegend(false);
}
else {
objects = redlineLayer.getMapObjects();
if (objects.size() > 0){
redlineLayer.removeObjects(objects);
}
}
// check if line is continuation of a route
if (gNumPoints > 0) {
gNumPoints = gNumPoints + numPoints;
for (i=0;i gPoints.add(points.item(i));
}
}
else {
gNumPoints = numPoints;
gPoints = points;
}
// Get user input
name = gMethod;
key = parent.rightFrame.document.RedlineForm.Key.value;
vertices = map.createObject("MGCollection");
numVertices = map.createObject("MGCollection");
numVertices.add(gNumPoints);
alert("You just digitized a polyline with "+ numPoints +" points");
// Get polyline vertices
for (i=0;i {
latVal = gPoints.item(i).getY();
lonVal = gPoints.item(i).getX();
point = map.lonLatToMcs(lonVal,latVal);
vertices.add(point);
}
// Add polyline

if (gAction == "Polyline"){
polyline = redlineLayer.createMapObject("",name,"");
alert("ondigitize");
polyline.addPolylinePrimitive(vertices,numVertices,true);

}
// map.refresh();

}
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.