[mapguide-users] Using DigitizePoint(handler) Errors
Chao Wang
wang45 at usc.edu
Thu Nov 4 01:07:25 EDT 2010
Hi all,
I want to use DigitizePoint(handler) to fetch the point I clicked on the
map. However, I cannot get the right results. I attach my code here, can you
help check the codes and tell about the mistakes in using. Did I use the
wrong structure of handler in DigitizePoint(handler);
<script language="javascript" type="text/javascript">
function Point(x,y) {
this.x = x;
this.y = y;
}
var p=new Point(0,0)
function getPoint() {
opener.top.showMap.mapFrame.DigitizePoint(p); //the structure
of frames is right, which means the DigitizePoint function can be reached.
document.write(p.x);
document.write(p.y);
return;
}
</script>
The expected out put of p.x and p.y would be the coordinates as the piont I
clicked, but right now it shows original value(0,0).
When I click the mouse on the map, it shows an error that "digihandler is
not a function", comes from the file of
mapguide2010/mapviewernet/mapframe.aspx. And the codes contains the error
is:
function OnShapeDigitized(shape)
{
if(digitizing)
{
digitizing = false;
if(digihandler != null)
{
digihandler(shape);
digihandler = null;
}
}
}
Any suggestions are helpful. Thanks.
More information about the mapguide-users
mailing list