More WorldMap questions

Sorry, but I have a few more questions about the WorldMap module.

  1. 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?

  2. 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 :frowning:
    Can it be disabled or force-hidden?

  3. 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.)

  4. Why is it not possible to create markers with infinite TTL ?

    • that line is commented out from source code! :frowning:
    • 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 :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.

Thanks if forward for any help! :slight_smile:

Hi

  1. That's probably a sensible default anyway - will add.

  2. 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)

  3. 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.
    Screenshot 2026-05-27 at 17.24.59

But yes - will push out v5.8.0 soon with the double click fix.

^ Thanks for the above and the quick answer ! :slight_smile:

Will wait for the fixes.

About MaxAge:

Obviously I knew about that, that why I'm telling You:

  • it is not working the way it should!
  • I've analysed Your code, and no matter, if I set 0 or Empty, markers will still disappear after a few days of running.
  • Max timeout can not be bigger than 2147483647ms = 24.8days !
    (There should be a check for that.)
  • It consumes unnecessary CPU + memory.

So probably it is a bug.

Looking at the code I guess I see what's wrong:

var maxage = 900;
...
    if (data.hasOwnProperty("ttl")) {  // save expiry time for this marker
        if (data.ttl > 0) {
            marker.ts = parseInt(Date.now()/1000) + Number(data.ttl);
        } 
// missing:
        else delete marker.ts;

        delete data.ttl;
    }
    else if (maxage > 0) {
        marker.ts = parseInt(Date.now()/1000) + Number(maxage);
    }
// Also missing:
    else { // if (maxage <= 0) 
        delete data.ts;
        // ??? what else ???

Just a quick note:

I've installed v5.8.0 the day it appeared, (also restarted NR, Ctrl+F5 in Browser,)
but double click still "zooms in". Both:

  • anywhere on the map,
  • and on any mark. :frowning:

Is there a "spacial way" to prevent it I haven't found yet?

Please recheck - I have just re-checked and double clicking on an icon no longer zooms in.
(double clicking on map does zoom in)

Try clearing the browser cache.

And how do I disable that behaviour ?

You don’t. You asked for

Which is what it now does.

Sorry, You are right! My bad.
Still, is it possible to disable double-click thing please?

Screenshot 2026-06-10 at 16.53.54

Obviously without those two disabled !
Users still need to:

  • zoom with mouse-scroll
  • zoom with touch-pull

OR

Are Your saying, if I disable those, I can still receive those events, and give order to WM to make the zoom somehow ?

EndDragging (move)

An other strange behaviour I've noticed:

  • if myPoint.clickable = false,
  • but myPoint.draggable = true,
  • I do not receive "action" = "move" events !

I think this is a BUG.
If myPoint.draggable = true I should be able to receive those, since the object is still draggable !

I would argue that you have to click to drag- so if can’t click then you can’t drag

Current behaviour is:

  • If "clickable" = false >> I still receive click events ! :+1:
    (This way I can decide what to do in the function.)
  • popped is disabled
  • but not receiving "move" events ! :-1:
  • while still can drag it!

This is totally inconsistent.

Fixed behaviour would be:

  • by disabling "clickable", everything would be disabled. (Like a GlobalSwitch)
    • no move
    • no events
    • no popup
  • ! But ! in this case we need to Introduce a new property: poppable to separate it.

This way we had:

  1. "poppable" : false disables popup only + popped events
  2. "draggable" : false disables dragging + "move" events
  3. ... maybe even introduce "rightclick" or "contextable" as 3th sub-option.
  4. "clickable" : false disables both 1 + 2 + 3 + click events = EVERYTHING

< OFF > Personal opinion:

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)

Will think about it while on vacation. Maybe.

Yes the draggable event should still occur if draggable is enabled - now fixed v5.8.1

Thanks for the quick fix!

  • Did You think about my proposals?

My goal was:

  • 1 click ->> Select
  • 2th click on the same, selected Mark ->> Pop Up!
  • 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 ?