Infrastructure Map Server Developer

Infrastructure Map Server Developer

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

Redlining a polyline

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

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 or visit the Installation and Licensing Forum to get help installing your software.