Reputation: 2240
I am trying to build an application that allows the user to set pre-defined regions over a map background. Rather than specifying X,Y coordinates I want them to be able to draw the regions on top of the map and then hit save. I then want to record those shapes to the database so I can present them again later on.
I have been looking at tutorials such as this one:
http://www.html5canvastutorials.com/labs/html5-canvas-drag-and-drop-resize-and-invert-images/
How would I go about starting to create this kind of functionality? Where should I look? I understand it is a large question and perhaps a little too broad but a list of options to consider would be an amazing answer.
If anyone has any tips on where I can get started it would be much appreciated.
Upvotes: 0
Views: 477
Reputation: 5649
That's a job for javascript. Ruby and HTML cannot do this alone. Basically in your javascript code you will have to listen for some events that trigger your save action(the user resizes the image or drags it away), then collect the data that you want to save(image position & size I guess) and then send this to the backend via an AJAX request. Then you can store it in the db.
Upvotes: 1