Sorry, but I have a few more questions about the WorldMap module.
How can I disable the "double-click => zoom" behavior? (If the user clicks twice on a marker, it should not zoom in)
I can see, there is a map.doubleClickZoom.disable(); command inside the .js code, but I do not know how to call it from a node?
In the top left corner, there is a Node-Red icon, which can be clicked, and that is closing the whole page and opening nodered.org instead
Can it be disabled or force-hidden?
Or even better would be to hide the upper titlebar completely, if possible? (It's just wasting precious vertical pixels for a big unnecessary title.)
Why is it not possible to create markers with infinite TTL ?
that line is commented out from source code!
it would not need to create timeouts, read default value, etc.
if =0 conflicts with other things, at least ttl: -1 should be possible to be used to skip starting doTidyUp() function at all.
var stale = null;
function setMaxAge() {
maxage = document.getElementById('maxage').value;
if (stale) { clearInterval(stale); }
//if (maxage > 0) { <<<< WHY ???
stale = setInterval( function() { doTidyUp() }, 20000); // clear markers from all layers every 20 secs
}
setMaxAge();
(Took me weeks of debugging my own code before realising what is causing my markers to disappear! )
IMHO there should be a big fat red warning about this default behaviour at the help, between Install and Usage.
Something like:
Warning
Markers will disappear after default timeout = ca. 600 seconds, if not updated.
Cleanup is happening every 20 seconds.
Default value can be changed at the upper-right menu, or by adding different value for each marker at creation. -1 = infinite. Example:{..., "ttl": 172800 } = 48 hours.
That's probably a sensible default anyway - will add.
and 3) - If you create your own webpage you can embed the worldmap in an iframe and it removes the top bar for you (That way you can have your own logos/ top bar etc)
you can already set the ttl per msg to 0 for infinite - or indeed set default for whole map using the node configuration page - which is fairly big and fat.
But yes - will push out v5.8.0 soon with the double click fix.
I fully understand, that developing something that is growing and changing is not easy. I face it myself day by day.
IMHO "clickable" was a bad choice for naming the "poppable" behaviour. But that's the past, we have to deal with it now, and keep some backward compatibility.
So we have to move forward, and the only way I see now is to:
make "clickable" a global thing,
and define sub-properties to fine tune how click should behave. (pop, move, context)
3th click on the same, selected Mark ->> Pop Down.
... clicking on something else ->> pop should disappear from the "unselected".
Currently if I click a Mark, there is a flickering, because first it pops up, what I immediatelly UnPop.
Whit this fix it will be possible to prevent automatic popup.
Just an other idea:
instead of: "click disabling" all Marks one by one,
introducing a global switch at WM setup window: "AutoPopup" (default true)
PS:
I know that pop + context can be "disabled" by setting them to "" empty string.
But destroying is not the same as "temporally preventing" from clicking it.
I'm testing my final work now with only 10 GPS points, and it's already taking >200ms to refresh all of them via MQTT. Already spent weeks to optimise whatever can be optimised to run those function as fast as possible. (Each of them is 50+ lines)
Rebuilding complex popup + context menus would consume even more CPU.
Especially with 200 GPS points on a non-cooled industrial POS PC with low arithmetic capabilities.
You should be able to just send the changes. So just the name of the marker and the new data. Why rebuild every time ? Can’t you hold prebuilt data at your end and send it or “” as appropriate ?