Infrastructure Map Server Developer

Posts: 3
Registered: ‎02-09-2005
Message 1 of 1 (30 Views)

Redlining a polyline

30 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");
else {
objects = redlineLayer.getMapObjects();
if (objects.size() > 0){
// 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");
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);
// Add polyline

if (gAction == "Polyline"){
polyline = redlineLayer.createMapObject("",name,"");

// map.refresh();


You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community