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