I’m trying to implement a LeafletJS + GoJS component in Angular. The fact it’s in Angular probably doesn’t matter a whole lot, but I’ll mention it anyway.
However, everything works except panning. I can zoom, select nodes, and get hover events on nodes.
I think the reason my implementation doesn’t work is because of the click/hover events I have wired up, which the example doesn’t have. If I use the Chrome Debugger and remove the mousedown event listener on the Canvas, the panning will work.
What I’m wondering is if I need to implement a custom PanningTool manager to bubble the events to LeafletJS. The interesting thing is I think at one time your example may have done that because the description has this sentence:
You can pan and zoom with Leaflet, and select and drag with GoJS. The GoJS div is on top of the Leaflet map, but this sample selectively bubbles events to leaflet by using a custom Tool.
Do you have a solution to the event bubbling handy?
Here is some of the relevant code I’m doing when setting up the diagram, just in case you already have an idea what I may have done wrong.
So do I understand you correctly that you do not want to use GoJS PanningTool?
What do you mean by: “click/hover events I have wired up”? Do you mean of GoJS objects or of Leaflet objects?
Yes, in that sample the DraggingTool has been customized to disable Leaflet’s dragging. See the overrides of DraggingTool.doActivate and DraggingTool.doDeactivate.
I guess I still don’t understand what the problem is. In the samples/leaflet.html sample, the PanningTool never runs. Panning is performed by Leaflet. Leaflet events call updatePosition which updates the Diagram.position.
I’ll try to make a smaller example showing the problem. But in the meantime was there a version of this sample that used a custom ToolManager to bubble the mouse events to LeafletJS like the description hints to? The sample description makes reference to a custom ToolManager.
Wow. Just wow. I figured it out while building the smaller example for you.
We’re running GoJS v2.1.49 – as soon as I used v.2.3.12, the mouse events started bubbling and the panning works. So that GoJS + LeafletJS sample requires a certain level of GoJS to work.
If you run it on GoJS 2.1.49 the panning will not work.