Infrastructure Map Server Forum
Welcome to Autodesk’s Infrastructure Map Server Forums. Share your knowledge, ask questions, and explore popular Infrastructure Map Server topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Redlining a polyline

0 REPLIES 0
Reply
Message 1 of 1
juebill
184 Views, 0 Replies

Redlining a polyline

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();

}
0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report