dceejay / RedMap

A web map app for Node-RED to put blobs on
Apache License 2.0
110 stars 60 forks source link

addlayer event delivered despite "add/remove layers" events unchecked #262

Closed gitToad closed 8 months ago

gitToad commented 9 months ago

Minor issue: even when configured to not deliver Add/Remove layer events, the addlayer event shows up in Worldmap in node when a marker is first added (to an existing or undefined layer)

worldmap 4.6.2

Untitled
dceejay commented 9 months ago

Which version of worldmap are you using ? Can you supply the actual example message you have that causes this ? (as I am failing to see the issue on a simple inject example)

gitToad commented 9 months ago

Here is a sample flow. WorldmapIn node has every event type disabled. I inject a marker 3 seconds after the flow starts.

Debug output shows:

2/27/2024, 11:50:11 AM[node: Worldmap events](http://localhost:1880/#)
worldmap : msg.payload : Object
{ action: "connected", parameters: object, clientTimezone: "America/Los_Angeles" }
2/27/2024, 11:50:12 AM[node: Worldmap events](http://localhost:1880/#)
worldmap : msg.payload : Object
{ action: "bounds", south: 37.37261278657826, west: -122.29637145996095, north: 37.44528946723517, east: -122.09346771240234 … }
2/27/2024, 11:50:14 AM[node: Worldmap events](http://localhost:1880/#)
worldmap : msg.payload : Object
{ action: "addlayer", name: "unknown" }

Actually this is additional (but perhaps related) puzzling behavior I discovered only while creating this minimal test flow: ie the silly situation where NO events are supposed to come from WorldmapIn, shows at least these three event types coming through.

If you enable ONLY "All other" in WorldmapIn, then you do NOT get the connected and bounds event, but you still get the addlayer event.

NodeRed v 3.1.5 Worldmap v 4.6.2


    {
        "id": "a61b47f9f0a5ee3e",
        "type": "tab",
        "label": "Flow 1",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "7b595f0c8f6ac710",
        "type": "worldmap in",
        "z": "a61b47f9f0a5ee3e",
        "name": "",
        "path": "/worldmap",
        "events": "",
        "x": 585,
        "y": 300,
        "wires": [
            [
                "c3deb820a6d9b80b"
            ]
        ]
    },
    {
        "id": "2ee86ec0f4f7b263",
        "type": "ui_worldmap",
        "z": "a61b47f9f0a5ee3e",
        "group": "60119caa3b01cc45",
        "order": 1,
        "width": 0,
        "height": 0,
        "name": "",
        "lat": "",
        "lon": "",
        "zoom": "",
        "layer": "OSMG",
        "cluster": "",
        "maxage": "",
        "usermenu": "hide",
        "layers": "show",
        "panit": "false",
        "panlock": "false",
        "zoomlock": "false",
        "hiderightclick": "true",
        "coords": "none",
        "showgrid": "false",
        "showruler": "false",
        "allowFileDrop": "false",
        "path": "/worldmap",
        "overlist": "DR",
        "maplist": "OSMG,OSMC,EsriC,EsriS,EsriT,EsriDG,UKOS",
        "mapname": "",
        "mapurl": "",
        "mapopt": "",
        "mapwms": false,
        "x": 580,
        "y": 240,
        "wires": []
    },
    {
        "id": "c3deb820a6d9b80b",
        "type": "debug",
        "z": "a61b47f9f0a5ee3e",
        "name": "Worldmap events",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 810,
        "y": 300,
        "wires": []
    },
    {
        "id": "1dcbcb4de51bae22",
        "type": "inject",
        "z": "a61b47f9f0a5ee3e",
        "name": "After 3 seconds",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": "3",
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 200,
        "y": 240,
        "wires": [
            [
                "6d9075d83f61c006"
            ]
        ]
    },
    {
        "id": "6d9075d83f61c006",
        "type": "function",
        "z": "a61b47f9f0a5ee3e",
        "name": "create marker",
        "func": "msg.payload = {\n    name: \"test\",\n    lat: 37.40900551029235,\n    lon: -122.19483862272087\n};\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 400,
        "y": 240,
        "wires": [
            [
                "2ee86ec0f4f7b263"
            ]
        ]
    },
    {
        "id": "60119caa3b01cc45",
        "type": "ui_group",
        "name": "Default",
        "tab": "2d38524258683708",
        "order": 1,
        "disp": false,
        "width": "22",
        "collapse": false,
        "className": ""
    },
    {
        "id": "2d38524258683708",
        "type": "ui_tab",
        "name": "Home",
        "icon": "dashboard",
        "disabled": false,
        "hidden": false
    }
]```