[mapguide-users] Add point to map
Paulo Veríssimo
pauloverissimo at hotmail.com
Thu Sep 10 12:24:43 EDT 2009
Hi
I'm trying to do a simple job with Mapguide Enterprise 2010 and php but I'm
not being succefull.
Hope someone can help.
The goal is to add a session point to a layer from a sdf feature source
already created. May be another one, if it becomes easier.
I already have a page where the user inputs the coordinates and scale and
the piece of javascript does the zoom and scale but than I want to draw a
point at that location calling a php page with all the needed parameters
including the coordinates.
What's the code for this final php file to add a point to the map?
Here is the code for the input page:
<script language='javascript'>
function gotoxy()
{ var coords=document.gotoxyform.inputbox.value;
if(coords.indexOf(',')>0)
{ var coordsplit=coords.split(',');
{ if(coordsplit.length==2)
{ var coordx=parseFloat(coordsplit[0]);
var coordy=parseFloat(coordsplit[1]);
var scale=parseFloat(document.gotoxyform.scalebox.value);
parent.parent.mapFrame.ZoomToView(coordx, coordy, scale, true);
}
document.location="zoomxy_execute.php?SESSION=<?= $sessionId
?>&MAPNAME=<?= $mapName ?>&x="+coordx+"&y="+coordy;
}
}
}
</script>
<form name='gotoxyform' action='javascript:gotoxy()' method='post'>
Input coordinates:
<input name='inputbox' value="-99000,-99000">
<br>
Input Scale:
<input name='scalebox' value="20000">
<br>
<input value='Zoom' type='submit'>
</form>
More information about the mapguide-users
mailing list