-
|
Heya! First of all, congrats on the new version of floorplan, amazing work! Now, my house has 3 floors. Currently, I have arranged them next to each other on the SVG. However, especially on my phone, this makes the floors tiny and hard to interact with. I think I saw projects in the past that had some kind of a floor switcher. My plan was to add three elements to the SVG, with click handlers that show/hide the appropriate floor. Unfortunately, I haven't really kept up with Javascript since the days of jQuery, so I'm a bit stumped how and where I could add my JS code. I tried to embed it in the SVG itself, but there it doesn't seem to get executed. And adding it in the document root makes the SVG elements somewhat inaccessible behind a plethora of Any ideas how I could achieve this? |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 34 replies
-
|
Hi One take could be to just have three views, and just switch between them with a service-call to HA. But I think @pkozul have talked about a way of handling multiple floors, but I need to check, if the first suggestion can't fit your needs :-) |
Beta Was this translation helpful? Give feedback.
-
|
Here is an example. This I use for an overview of the house. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @exetico - very glad to see this get off the ground, awesome work. In the old floorplan there was floorplan.class_toggle that I use to switch floors. It's currently missing from this implementation but it was a very easy way of hiding or showing SVG layers. |
Beta Was this translation helpful? Give feedback.
-
|
Hello. I'm also trying to manipulate (hide or unhide) the layers in the svg file, but unfortunately I'm not getting through with this version. My svg file is organized with several layers. I have layers that contain floor, layer that contains rooms and before I visible or unvisible each one, if anyone has any idea how to do this in this version I would appreciate it very much. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for your quick reply. I'll try to explain it better with a very simple file: I have an svg file with two layers called page1 and page0. On page1 I have a rectangle with id: toggle_button and on page page0 I have any rectangle. I want to click on the rectangle with id: toggle_button and make the layer page0 visible or hidden. I tried this in this version but nothing happens, the page0 layer is not visible. There is also no error log. here is yaml file: Here the ccs file: And here is xml of file layers.svg |
Beta Was this translation helpful? Give feedback.
-
|
also make sure you can toggle the floor using a class on the chrome dev tools. then look to hook it up in HA. |
Beta Was this translation helpful? Give feedback.
Here is an example. This I use for an overview of the house.