fixup small border tweaks for ui worldmap
This commit is contained in:
parent
cfb9f7feda
commit
6edac99bd3
@ -389,7 +389,7 @@ then by default <code>⌘⇧m</code> - <code>ctrl-shift-m</code> will load the m
|
|||||||
panit: {value:"false"},
|
panit: {value:"false"},
|
||||||
panlock: {value:"false"},
|
panlock: {value:"false"},
|
||||||
zoomlock: {value:"false"},
|
zoomlock: {value:"false"},
|
||||||
hiderightclick: {value:"false"},
|
hiderightclick: {value:"true"},
|
||||||
coords: {value:"false"},
|
coords: {value:"false"},
|
||||||
showgrid: {value:"false"},
|
showgrid: {value:"false"},
|
||||||
path: {value:"/worldmap"}
|
path: {value:"/worldmap"}
|
||||||
|
20
worldmap.js
20
worldmap.js
@ -124,26 +124,20 @@ module.exports = function(RED) {
|
|||||||
}
|
}
|
||||||
RED.nodes.registerType("worldmap",WorldMap);
|
RED.nodes.registerType("worldmap",WorldMap);
|
||||||
|
|
||||||
|
|
||||||
function HTML(ui, config) {
|
function HTML(ui, config) {
|
||||||
var width = config.width;
|
var width = config.width;
|
||||||
if (width == 0) {
|
if (width == 0) {
|
||||||
var group = RED.nodes.getNode(config.group);
|
var group = RED.nodes.getNode(config.group);
|
||||||
if (group) {
|
if (group) { width = group.config.width; }
|
||||||
width = group.config.width;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
var height = config.height;
|
var height = config.height;
|
||||||
if (height == 0) {
|
if (height == 0) { height = 10; }
|
||||||
height = 10;
|
|
||||||
}
|
|
||||||
var size = ui.getSizes();
|
var size = ui.getSizes();
|
||||||
var frameWidth = (size.sx +size.cx) *width -size.cx -10;
|
var frameWidth = (size.sx +size.cx) *width - size.cx - 1;
|
||||||
var frameHeight = (size.sy +size.cy) *height -size.cy -10;
|
var frameHeight = (size.sy +size.cy) *height - size.cy - 2;
|
||||||
var url = encodeURI(config.path);
|
var url = encodeURI(config.path);
|
||||||
var html = `
|
var html = `<div style="overflow:hidden;">
|
||||||
<div>
|
<iframe src="${url}" width="${frameWidth}px" height="${frameHeight}px" style="border:none;"></iframe>
|
||||||
<iframe src="${url}" width="${frameWidth}px" height="${frameHeight}px" style="border: none;"></iframe>
|
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
return html;
|
return html;
|
||||||
@ -158,7 +152,7 @@ module.exports = function(RED) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var ui = undefined;
|
var ui = undefined;
|
||||||
|
|
||||||
function UIWorldMap(config) {
|
function UIWorldMap(config) {
|
||||||
try {
|
try {
|
||||||
var node = this;
|
var node = this;
|
||||||
|
@ -266,9 +266,11 @@ function doLock(v) {
|
|||||||
if (v !== undefined) { lockit = v; }
|
if (v !== undefined) { lockit = v; }
|
||||||
if (lockit === false) {
|
if (lockit === false) {
|
||||||
mb = new L.LatLngBounds([[-120,-360],[120,360]]);
|
mb = new L.LatLngBounds([[-120,-360],[120,360]]);
|
||||||
|
map.dragging.enable();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
mb = map.getBounds();
|
mb = map.getBounds();
|
||||||
|
map.dragging.disable();
|
||||||
window.localStorage.setItem("lastpos",JSON.stringify(map.getCenter()));
|
window.localStorage.setItem("lastpos",JSON.stringify(map.getCenter()));
|
||||||
window.localStorage.setItem("lastzoom", map.getZoom());
|
window.localStorage.setItem("lastzoom", map.getZoom());
|
||||||
window.localStorage.setItem("lastlayer", baselayername);
|
window.localStorage.setItem("lastlayer", baselayername);
|
||||||
|
Loading…
Reference in New Issue
Block a user