From 44e9fe79e97211da6cbf0414ad50e29c309ed91a Mon Sep 17 00:00:00 2001 From: Vaishnav Nair Date: Sun, 24 Jul 2022 23:37:54 +0530 Subject: [PATCH] [requested-changes] Keep original aspect ratio of the image --- examples/data/netjsonmap-indoormap.json | 18 +- examples/netjsonmap-indoormap.html | 214 +++++++++++++----------- 2 files changed, 124 insertions(+), 108 deletions(-) diff --git a/examples/data/netjsonmap-indoormap.json b/examples/data/netjsonmap-indoormap.json index 13ea82df..0e586faf 100644 --- a/examples/data/netjsonmap-indoormap.json +++ b/examples/data/netjsonmap-indoormap.json @@ -8,47 +8,47 @@ "nodes": [ { "id": "i3ehd7", - "location": {"lat": 47.49, "lng": 12.298496093750002}, + "location": {"lat": 43.89, "lng": 12.098496093750002}, "name": "Family room" }, { "id": "i74rhs", - "location": {"lat": 48.5007394591129, "lng": 28.47153358459473}, + "location": {"lat": 45.5007394591129, "lng": 28.27153358459473}, "name": "Lounge" }, { "id": "5vjb7b", - "location": {"lat": 47.863304126849265, "lng": 6.294136047363282}, + "location": {"lat": 44.393304126849265, "lng": 6.094136047363282}, "name": "Bedroom 1" }, { "id": "liwv7p", - "location": {"lat": 44.89718091651456, "lng": 28.944869232177738}, + "location": {"lat": 39.49718091651456, "lng": 28.644869232177738}, "name": "Bedroom 4" }, { "id": "m7qhnj", - "location": {"lat": 47.530760483351195, "lng": 24.609127044677738}, + "location": {"lat": 43.930760483351195, "lng": 24.369127044677738}, "name": "Study Area" }, { "id": "a0mg9w", - "location": {"lat": 44.99, "lng": 18.435201263427738}, + "location": {"lat": 39.89, "lng": 18.135201263427738}, "name": "Dining room" }, { "id": "dsm2x7", - "location": {"lat": 50.559382175122965, "lng": 13.955840454101564}, + "location": {"lat": 48.859382175122965, "lng": 13.955840454101564}, "name": "Bedroom 2" }, { "id": "nwlpcd", - "location": {"lat": 50.57788524115151, "lng": 19.339492797851566}, + "location": {"lat": 48.67788524115151, "lng": 19.039492797851566}, "name": "Bedroom 3" }, { "id": "9p0bos", - "location": {"lat": 51.736490408464164, "lng": 25.936660766601562}, + "location": {"lat": 49.736490408464164, "lng": 25.516660766601562}, "name": "Garage" } ], diff --git a/examples/netjsonmap-indoormap.html b/examples/netjsonmap-indoormap.html index 66a972fb..be891928 100644 --- a/examples/netjsonmap-indoormap.html +++ b/examples/netjsonmap-indoormap.html @@ -1,121 +1,137 @@ + + Indoor map + + + + + - - Indoor map - - - - - + + + + + + - + // remove the geographic map + netjsonmap.eachLayer((layer) => { + if (layer._url) { + netjsonmap.removeLayer(layer); + } + }); + // add indoormap image + L.imageOverlay(image, bounds).addTo(netjsonmap); + this.utils.hideLoading(); + }, + }); - \ No newline at end of file + graph.render(); + + +