hi anand

try to use this:

var xframe = GetMapFrame();
function DigitizeLine() {
xframe.DigitizeLine(OnLineDigitized);
}

instead of:

function DigitizeLine() {
parent.parent.mapFrame.DigitizeLine(OnLineDigitized);
}

andrea

-----Original Message-----
From: mapguide-users-boun...@lists.osgeo.org
[mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of anand
Sent: venerdì 19 agosto 2011 06:11
To: mapguide-users@lists.osgeo.org
Subject: [mapguide-users] Invoke Script

hi all,

I've used invoke script to add a button to draw line and i've written the
following code in the script command text window. Now the problem is when i
click the button nothing happens. I don't know what is the problem. The
following is the code which i am using:


function DigitizeLine() {
parent.parent.mapFrame.DigitizeLine(OnLineDigitized);
}
function OnLineDigitized(line)
{
//prompt(line.Point(0).X);
var params = new Array(
"x0", line.Point(0).X,
"y0", line.Point(0).Y,
"x1", line.Point(1).X,
"y1", line.Point(1).Y,
"MAPNAME",parent.mapFrame.GetMapName(),
"SESSION",parent.mapFrame.GetSessionId());
parent.formFrame.Submit("../proj/gis/Draw_Line.aspx",params, "scriptFrame");
//parent.formFrame.Submit("../proj/gis/Draw_Line.aspx",params,
"taskPaneFrame");
}
DigitizeLine()

--
View this message in context:
http://osgeo-org.1803224.n2.nabble.com/Invoke-Script-tp6701807p6701807.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
_______________________________________________
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users

--
This message was scanned by ESVA and is believed to be clean.

_______________________________________________
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users

Reply via email to