[mapguide-users] Invoke Script

andrea tiveron (e-metodi) andrea.tiveron at e-metodi.it
Fri Aug 19 09:05:52 EDT 2011


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-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of anand
Sent: venerdì 19 agosto 2011 06:11
To: mapguide-users at 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 at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users

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



More information about the mapguide-users mailing list