I can create buttons in the map and register the click event to the worldmap in node and receive the action but now what.... care to point me in the right direction ?
Why not just add the action to the button itself ? No need to send to the backend ?
Oh I thought about doing that using onclick and doing that but I have other logic outside of the map I want to forward the user to a url.
This all comes back to the camera system I created using worldmap. That way I can trigger the action as well.
I just wanted to make sure I was not missing a easy solution before diggin in the innards.
If its not possible I'll pull up your github repo and start reading and maybe code it in.
Ohhhhhh......... just found the code for the 3d view. Looks like I can build on this to do what I want.
document.addEventListener ("keydown", function (ev) {
// Set Ctl-Alt-3 to switch to 3d view
if (ev.ctrlKey && ev.altKey && ev.code === "Digit3") {
ws.close();
window.location.href = "index3d.html";
}
// Set Esc key to close all open popups
if (ev.keyCode === 27) {
map.eachLayer(function (layer) {
layer.closePopup();
});
}
});
now I just need to tie it into the button or .........better create a new command object for Controlling the map. hmmmm what to call it?
Also the main benefit for all of this is to keep local network users from loading the map from a saved url. I need them to login because ive had some bad actors..... Who would have thought that a user would just keep loading cameras and leaving them open boggin down the camera server to all hell.
Fake names used:
So Jenny needs access to the cameras to check on theft. But then one day she decides she wants to have the parking lot camera streaming in her borwser so she can watch in on her new car. Well Jeff from accounting see the camera on her screen and asks, "hey how you get that? "
Well 2 weeks later I have a server bogged down with about 20 people all with cameras streaming all sorts of things. I ask Paul from the warehouse " why do you need to stream the cafeteria? and he says "don't want no one messing with my lunch."