I am building a facility management app. I have been given a .DWG file of the floor plan that I want to show on the app and make the desks and chairs clickable so that employees of that facility can book it. Much like how you would book a seat in a plane by clicking on the seat in the image.
I converted the file to an SVG. Initially the file size of the SVG after conversion was over a 100 Mb. So I cleared the layers in the DWG, converted it to an SVG and after compression, got the SVG size to 1.1MB. This hampered the quality of the SVG severely. On top of it, the app was still unable to open the SVG smoothly and kept crashing at times. This makes me think that converting to SVG is not the best approach. Any advice on how this can be done?
Shubham Kackar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
Your SVG is still quite large and it might be useful to look into what happens at the moment the app crashes to make sure if its due to memory or something else in your code.
If futher simplification of the DWG layers to make the SVG smaller is not possible, I would recommend lookinging into breaking it down into smaller sections e.g. simple segmentation by loading the smaller sections as and when needed. You can also convert the DWG into vector tiles using tools like Mapbox or Tangram.
Alternatively, you can try rendering it on a canvas instead which might be better performance wise with graphics.