-
-
Notifications
You must be signed in to change notification settings - Fork 148
[feature] Add floorplan map above dashboard map #564 #680
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
0f2201e to
ebecb10
Compare
pandafy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dee077 we don't need for openwisp/netjsongraph.js#381 to get merged. You can build your branch of netjsongraph.js locally and copy the netjsongraph.min.js in openwisp-monitoring. Please do this in a separate commit.
While testing, I noticed a bug which changed the width of the dashboard map container. @cestercian is already working on a fix in #335. You can either override the required CSS here temporarily till that PR is merged.
This worked for me
diff --git a/openwisp_monitoring/device/static/monitoring/css/netjsongraph.css b/openwisp_monitoring/device/static/monitoring/css/netjsongraph.css
index 05cd643..c23870d 100755
--- a/openwisp_monitoring/device/static/monitoring/css/netjsongraph.css
+++ b/openwisp_monitoring/device/static/monitoring/css/netjsongraph.css
@@ -9,7 +9,7 @@
border: 1px solid #ccc;
color: #6d6357;
line-height: 20px;
- max-width: 400px;
+ /* max-width: 400px; */
min-width: 200px;
padding: 10px 15px;
}On narrower screens, the overlay shows a horizontal scroll bar. This is inconsistent with the handling of map on narrow screens. The horizontal scroll should not appear. The overlay of the floorplan widget, should automatically adjust to the dimensions of the map container.
I understand that right now we are focusing on the API changes. So, I am not pointing out changes required in the UI. We aim to develop a similar UI to the mockups.
| class Meta: | ||
| model = DeviceLocation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you extend the Meta class of FloorplanCoordinatesSerializer, then you won't need to re-define model here.
| class Meta: | |
| model = DeviceLocation | |
| class Meta(FloorplanCoordinatesSerializer.Meta): |
pandafy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dee077 whenever you create a PR which depends on a different PR in another module, please update the requirements.txt file like below so installing openwisp-monitoring using pip would automatically install the correct version of openwisp-controller.
diff --git a/requirements.txt b/requirements.txt
index 6f4b6b0..d1c706f 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,4 +1,6 @@
-openwisp-controller @ https://github.com/openwisp/openwisp-controller/tarball/1.2
+openwisp-controller @ https://github.com/dee077/openwisp-controller/tarball/feature/828-api-indoor-map-coordinates
influxdb~=5.3.2
django-nested-admin~=4.1.1
python-dateutil>=2.7.0,<3.0.0Without this, CI would fail. We didn't encounter this yet since we don't have CI enabled on the gsoc25-map branch yet.
I noticed an issue in the UI
Steps to replicate
- Open a floorplan and interact with the floorplan (zoom in/zoom out)
- Close the floorplan
- Zoom out the geographic map
device-map-2025-07-01_16.29.15.mp4
72acd27 to
c39cc69
Compare
6d717df to
135c683
Compare
| map.setView([0,0], 0) | ||
| }; | ||
| // Todo: Explore some better approach if exists | ||
| const fullScreen = $('#floorplan-container .leaflet-control-fullscreen-button'); | ||
| fullScreen.off("click.zoomOnFullscreen"); // avoid duplicates | ||
| fullScreen.on("click.zoomOnFullscreen", () => { | ||
| map.setZoom(map.getZoom() + 1); | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a comment explaining what we are trying to achieve here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
device-map-2025-07-22_18.55.46.mp4
The zoom level changes drastically when entering/exiting the fullscreen mode.
- Added a Floorplan button below the device table - On click a new container is created and renders the floorplan map using Netjsongraph - Currently using static data from Netjsongraph's examples - Will integrate dynamic data fetching via REST API and render on AJAX success Fixes #564
…tructure for storing all floors data
3cc1a7e to
ffa29b9
Compare
|
Closing as #688 is built on top of this PR |

Checklist
Reference to Existing Issue
Closes #564.
Description of Changes
Netjsongraph.Screenshot
Screencast.from.2025-06-13.00-28-12.webm