I've been brainstorming a concept for a map that includes Layers functionality.
Starting with an initial map image in SVG format, my goal is to incorporate Layers onto it. Each layer will contain a set of objects (polygon coordinates). After drawing polygons on one Layer, I plan to send the coordinates of all objects to a database and store them as a document in MongoDB. This document will include the Name of the Layer and an array with the objects' coordinates. The next step involves implementing a toggle switch button to turn Layers on/off on the original map. By fetching the coordinates from the database, these layers can be added or removed accordingly.
Is it feasible to develop such functionality using SVG?
The idea is to group polygons in each Layer with the <g>
tag, ensuring that each polygon has a unique class for easy identification. Is this approach correct?