问题
I'm planning to create a floor planner app that allows users to draw, resize, move and rotate objects with the mouse. I was just wondering if it would be better to use Flash or Javascript. If using Javascript, should I use canvas or SVG? The app will allow drag selection to select multiple items.
I'm trying to make up my mind with performance and browser support placed as top priority. Do you guys have any suggestions and resources that you could point me to if Javascript is the better option?
回答1:
I would absolutely go for SVG for this application. (and I say this as a lover of Canvas)
You won't need the performance of Canvas since the floorplan won't be animated. If you expect your floorplans to dance and sing and play Tetris then you'd want Canvas.
All SVG objects are already DOM objects and have all the associated event handlers, which will allow you to create your application much faster with less headaches. With Canvas you'd have to do all the hit-detection and keeping track on your own.
SVG/VML is supported in all major browsers (all the way down to Internet Explorer 6!) so you'll have maximum compatibility.
来源:https://stackoverflow.com/questions/6118546/svg-canvas-vs-flash-for-floorplanner-app