dceejay / RedMap

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

[2.0.5-beta] TypeError: layercontrol.removeFrom is not a function #94

Closed oliv3 closed 5 years ago

oliv3 commented 5 years ago

Hi, this happens most probably because I remove some layers with a map command.

oliv3 commented 5 years ago

Indeed, those removed still appear in the layers drop-down menu.

dceejay commented 5 years ago

Do you have an small example flow to help me recreate ?

oliv3 commented 5 years ago

Sure, here you have: [{"id":"e1e047f8.2d0f8","type":"tab","label":"Issue #94","disabled":false,"info":""},{"id":"1db5af68.edceb9","type":"worldmap","z":"e1e047f8.2d0f8","name":"","lat":"","lon":"","zoom":"","layer":"","cluster":"","maxage":"","usermenu":"show","layers":"show","panit":"false","panlock":"false","zoomlock":"false","hiderightclick":"false","coords":"none","showgrid":"false","path":"/issue94","x":580,"y":80,"wires":[]},{"id":"33fdc60a.3a9d6a","type":"worldmap in","z":"e1e047f8.2d0f8","name":"","path":"/issue94","x":130,"y":80,"wires":[["cb51ffd0.bd2ee8"]]},{"id":"cb51ffd0.bd2ee8","type":"function","z":"e1e047f8.2d0f8","name":"Delete map layers","func":"msg.payload = {\n command: {\n map: {\n delete: [\n \"UK OS 1919-47\",\n \"UK OS 1900\",\n \"UK OS Opendata\",\n \"Hike Bike\",\n // \"Terrain\",\n \"Nat Geo\",\n // \"Watercolor\",\n \"ship nav\",\n \"public transport\",\n // \"heatmap\",\n \"railways\",\n \"roads\",\n // \"buildings\",\n \"day/night\",\n \"countries\",\n \"drawing\"\n ]\n }\n }\n};\n\nreturn msg;\n","outputs":1,"noerr":0,"x":350,"y":80,"wires":[["1db5af68.edceb9"]]}]

dceejay commented 5 years ago

changing the line in error to map.removeControl(layercontrol); fixes it (will be in next drop - but halfway through some other changes)

dceejay commented 5 years ago

closed by 2.0.6-beta