-
Notifications
You must be signed in to change notification settings - Fork 0
/
dash.json
1 lines (1 loc) · 3.14 KB
/
dash.json
1
{"version":1,"allow_edit":true,"plugins":["/views/board/tutorial.min.js","/plugins/all"],"panes":[{"title":"Map","width":1,"row":{"3":1,"4":1},"col":{"3":2,"4":1},"col_width":2,"widgets":[{"type":"plugin531a3b2b7df9e78c7300000f","settings":{"html":"\nvar lat = parseFloat(datasources[\"lat\"][\"field1\"]);\nvar lng = parseFloat(datasources[\"lng\"][\"field2\"]);\nvar url_string = window.location.href\nvar url = new URL(url_string);\nvar bid = url.searchParams.get(\"BID\");\nreturn `<html>\n<body>\n<link rel=\"stylesheet\" href=\"https://unpkg.com/leaflet@1.5.1/dist/leaflet.css\"\n integrity=\"sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ==\"\n crossorigin=\"\"/>\n<script src=\"https://unpkg.com/leaflet@1.5.1/dist/leaflet.js\"\n integrity=\"sha512-GffPMF3RvMeYyc1LWMHtK8EbPv0iNZ8/oTtHPx9/cc2ILxQ+u905qIwdpULaqDkyBKgOaB57QTMg7ztg8Jm2Og==\"\n crossorigin=\"\"></script>\n<style>\n#mapid { height: 600px;\nwidth: 600px;}\n</style>\n<div id=\"mapid\"></div>\n\n</body>\n<script>\nvar mymap = L.map('mapid').setView([`+lat+`, `+lng+`], 16);\nL.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoicnJyYWpwdXQiLCJhIjoiY2p6OGVvZGlnMGwyYTNtbnlrNm9iN2ptMCJ9.cFzS8HLWt7sWIF_3sNci4Q', {\n attribution: 'Map data © <a href=\"https://www.openstreetmap.org/\">OpenStreetMap</a> contributors, <a href=\"https://creativecommons.org/licenses/by-sa/2.0/\">CC-BY-SA</a>, Imagery © <a href=\"https://www.mapbox.com/\">Mapbox</a>',\n maxZoom: 18,\n id: 'mapbox.streets',\n accessToken: 'your.mapbox.access.token'\n}).addTo(mymap);\nvar myIcon = L.icon({\n\ticonUrl: 'https://cdn3.iconfinder.com/data/icons/hotel-service-gray-set-1/100/Untitled-1-22-512.png',\n\ticonSize: [38, 38],\n});\n\nvar marker = L.marker([`+lat+`, `+lng+`],{icon: myIcon,title:'Bag_24'}).addTo(mymap);\nmarker.bindPopup(\"<b>Bag `+bid+`</b>\");\nmarker.on('mouseover', function (e) {\n this.openPopup();\n });\n marker.on('mouseout', function (e) {\n this.closePopup();\n });\n</script>\n</html>`","height":"8"}}]},{"width":1,"row":{"3":1,"4":1},"col":{"3":1,"4":1},"col_width":1,"widgets":[{"type":"plugin531a3b2b7df9e78c7300000f","settings":{"html":"var lat = datasources[\"lat\"][\"field1\"];\nvar lng = datasources[\"lng\"][\"field2\"];\nvar time = String(datasources[\"lat\"][\"created_at\"]);\nvar url_string = window.location.href\nvar url = new URL(url_string);\nvar bid = url.searchParams.get(\"BID\");\nreturn `<br><b>Bag `+bid+`</b></br>\n<br>Latitude : `+lat+`</br>\n<br> Longitude : `+lng+`</br>\n<br> Retrieved:`+time.substring(11,16)+` on `+time.substring(0,10)+`</br>`","height":4}}]}],"datasources":[{"name":"lat","type":"plugin52b0be5c88ca16c9ae000005","settings":{"url":"https://api.thingspeak.com/channels/458662/fields/1/last.json?api_key=H162C5Q6K1X4CY57","use_thingproxy":true,"refresh":60,"method":"GET"}},{"name":"lng","type":"plugin52b0be5c88ca16c9ae000005","settings":{"url":"https://api.thingspeak.com/channels/458662/fields/2/last.json?api_key=H162C5Q6K1X4CY57","use_thingproxy":true,"refresh":60,"method":"GET"}}],"columns":3,"pane_header_bg_color":null,"pane_bg_color":null}