[mapguide-users] Need help with one specific function

Jackie Ng jackie.ng at aecsystems.com.au
Mon Jun 4 04:25:16 EDT 2007


You use the DigitizePoint(func) function of the mapframe.

For the "func" argument supply a reference to a handler function. 

The handler function will receive a point object from the user's input,
which you can then invoke a server-side script passing in your digitized
point as a parameter

Then on the server side, create your point object from the parameters and
add an MgInsertFeatures object containing this point to a feature command
queue. Call UpdateFeatures() on the command queue and your point should be
inserted into the Feature Source.

So step 1 should really be:

Create a handler function for the DigitizePoint() method. This should invoke
your php script.

eg: 

function PointDigitized(point)
{
     //Call your php script passing point.x and point.y
}

Step 2 is fine. 
Step 3 should then be:

call mapFrame.DigitizePoint(PointDigitized); 

Which will start the whole process.

Hope that helps.

- Jackie


Krunoslav wrote:
> 
> Hi all.
> 
> I'm trying to set up a php based task in Taskpane frame, where users could
> insert object into the map (to be exact, to insert new objects into MySQL
> map layer). So far I made input fields to select all properties of new
> object. What I'm not sure how to do is how will the users enter X and Y
> coordinates of an object. I know that I can make X and Y input fields, and
> then save it all to database, but I know there must be some better way. On
> of ideas is to make Right-click action , for example "Enter coordinates"
> which would pass X and Y coordinates from MapFrame to input fields in
> TaskPane, but I'm not sure what would be right procedure to achieve this.
> 
> 1. To write javascript function which would pick up the coordinates
> 2. To write new php script which would format the coordinates, and pass
> them to taskpane
> 3. To add this function to right-click menu on the map
> 
> Am I on right track, or this should be done differently ?
> 
> 

-- 
View this message in context: http://www.nabble.com/Need-help-with-one-specific-function-tf3863384s16610.html#a10945635
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list