Currenlty I have a drawing utility that allows users to add lines, polygons or points (symbols) to their local map in the MG viewer. I have managed to (as a test) extract the symbol attributes, and lat/long of the point added with an alert box in the map. I would like to know how this data can be populated within a database. So when a user adds a hydrant symbol for instance, it will be added on a hydrant layer, (instead of the redline layer) and have the data populate in the database. The rest of the users would then be able to see the symbol within their map, as the database would be dynamic. I'm pretty sure this can be done.
I hope this makes sense. I do not have the DAT extension, and am using MG6. Any hellp would be greatly appreciated.
how i saw you need update your database when the user make add point for
example (hydrant) in his map ,well you need put maybe before or runtime of
layer with this dtabase and when the ondigitisepoint event fire you connect
to database make a insert statement with data of point digitized and any
else data you need input and close connection .all maps with dynamic
propertie anywhere will update and saw the points added.
i hope can help you
Cesar A. Sandoval M.
Developer Specialist in GIS/CAD/WEB
PROFILE CONSULTING GROUP S.A.
I've tried using a CFinsert to populate the data that is retrieved but that is not working either. I'm get errors that either say columns don't exist in the table, or the option is not implemented. I have full control of the database and the network it resides on.
Does anyone else have any suggestions? Sample code would be a huge plus.
When using the Insert with the CFquery, did you create an "Action" page to insert the data in first, before you brought it into the database?
I guess I'm refering to the website parameter you added in your code example. I would like to populate the database directly from what the user adds in the viewer, without first populating an action page (form).
Thanks for the reply, you've giving me some direction I deperately need.
Indeed, I used an "Action" page to get some additional information from the
user. But if you don't need any user info, you can also call the insert
page directly from the onDigitizedPoint function. The insert page can be
anything from a "Thank you for Clicking" page to a GUI less page which will
run in a hidden frame.
onDigitizedPoint will provide you with a point from which you can get the X
and Y values. These values can be used to open the insert page in your
application which will populate the databasetable and refreshes the map.
function onDigitizedPoint(map, point)
var Y = point.getY();
var X = point.getX();
var insertPage = 'insert.cfm?x='+X+'&y='+Y;
insert.cfm would look something like this:
INSERT INTO myDatabaseTable
Thanks for the help. I have the database info getting populated. Although when I refresh the screen the point is added to the database again, and again, it seems to be storing the value in the insert.cfm. But I should be able to set a zero value to the query in order to stop it populating.
Thanks again, this is a very good start to populating the rest of the data I need.