Infrastructure Map Server Forum
Welcome to Autodesk’s Infrastructure Map Server Forums. Share your knowledge, ask questions, and explore popular Infrastructure Map Server topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Populating a Database

6 REPLIES 6
Reply
Message 1 of 7
kb
180 Views, 6 Replies

Populating a Database

Hi,

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.

Thanks,
kb
6 REPLIES 6
Message 2 of 7
Anonymous
in reply to: kb

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
best regards

--

--
Cesar A. Sandoval M.
Developer Specialist in GIS/CAD/WEB
PROFILE CONSULTING GROUP S.A.
www.profileconsulting.net
Message 3 of 7
kb
in reply to: kb

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.
Message 4 of 7
Anonymous
in reply to: kb

A Walk Down Memory Lane, back in the days of MG3 this functionality was
known as
"put yourself on the map" and was featured on mapguide.com.

I haven't used Cold Fusion in a while, but I used to skip CFINSERT and
generally used CFQUERY (mind the single quotes for text inserts)


INSERT INTO website
(lon, lat, sitename)
VALUES(#lon#, #lat#, '#sitename#')


Hope this helps
Message 5 of 7
kb
in reply to: kb

Hi,

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.
Message 6 of 7
Anonymous
in reply to: kb

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;
parent.insertFrame.location.replace(insertPage);
}

insert.cfm would look something like this:


INSERT INTO myDatabaseTable
(x, y)
VALUES(#x#, #y#)







Many Thanks for adding a new point to the layer

Message 7 of 7
kb
in reply to: kb

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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report