We've discovered cartodb and we want to use it in our project, but in the API documentation we've only seen the sql.execute() method (docs) in order to insert a now row in a table.
Is this the way to insert points dynamically in our map?
We've discovered cartodb and we want to use it in our project, but in the API documentation we've only seen the sql.execute() method (docs) in order to insert a now row in a table.
Is this the way to insert points dynamically in our map?
You can't execute write queries from the javascript client code, in order to insert a point in a table you need to write your own backend server, like:
http://{account}.cartodb.com/api/v2/sql?q=INSERT INTO test_table (column_name, column_name_2, the_geom) VALUES ('this is a string', 11, ST_SetSRID(ST_Point(-110, 43),4326))&api_key={Your API key}
or use postgres functions with security definers:
http://blog.cartodb.com/post/53510434258/read-and-write-to-cartodb-with-the-leaflet-draw-plugin