Hi folks,
currently I try to use the panning inside a svg-graphics node to move a spot light.
Attached simple flow shows what I did so far:
[{"id":"a03bd3cf.177578","type":"tab","label":"svg-panning-test","disabled":false,"info":""},{"id":"100d8947.43b66f","type":"ui_svg_graphics","z":"a03bd3cf.177578","group":"1e71a25b.2d361e","order":0,"width":"3","height":"3","svgString":"<svg x=\"0\" y=\"0\" width=\"144\" height=\"144\" viewBox=\"0 0 144 144\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:svg=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <circle id=\"myCircle\" cx=\"72\" cy=\"72\" r=\"20\" color=\"red\" outline=\"black\"/>\n</svg>","clickableShapes":[{"targetId":"#myCircle","action":"click","payload":"mouse click","payloadType":"str","topic":"#myCircle"},{"targetId":"#myCircle","action":"touchstart","payload":"touch start","payloadType":"str","topic":"#myCircle"},{"targetId":"#myCircle","action":"touchend","payload":"touch end","payloadType":"str","topic":"#myCircle"}],"smilAnimations":[],"bindings":[],"showCoordinates":false,"autoFormatAfterEdit":false,"showBrowserErrors":false,"outputField":"payload","editorUrl":"//drawsvg.org/drawsvg.html","directory":"","panning":"both","zooming":"disabled","panOnlyWhenZoomed":false,"doubleClickZoomEnabled":false,"mouseWheelZoomEnabled":false,"name":"svg-graphics","x":290,"y":180,"wires":[["2b67b3da.0a10cc"]]},{"id":"2b67b3da.0a10cc","type":"debug","z":"a03bd3cf.177578","name":"log events","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":500,"y":180,"wires":[]},{"id":"1e71a25b.2d361e","type":"ui_group","z":"","name":"svg-panning-test","tab":"d81e78f0.ebcac8","order":4,"disp":true,"width":"3","collapse":false},{"id":"d81e78f0.ebcac8","type":"ui_tab","z":"","name":"Home","icon":"home","order":1,"disabled":false,"hidden":false}]
I created a red circle and activated panning for both directions (x and y).
Additionally I registered the circle to receive following events:
-
Mouse clicked
-
Touch start
-
Touch end
When I try this on my desktop, i.e. press Mouse on circle -> pan circle -> release mouse, svg-node delivers this msg object, containing the event including the positions for the mouse release:
{"topic":"#myCircle","elementId":"myCircle","selector":"#myCircle","event":{"type":"click","svgX":72.5,"svgY":77,"pageX":1612,"pageY":214,"screenX":1661,"screenY":349,"clientX":1612,"clientY":214,"bbox":[1591.5,229,1631.5,189]},"payload":"mouse click","socketid":"_jzbtXVRt2MRmM3BAABA","_msgid":"8d0c3fa3.a445b"}
Now, when I do the same on my mobile, i.e. tap circle -> pan circle -> release circle, svg-node comes with two messages (as expected):
{"topic":"#myCircle","elementId":"myCircle","selector":"#myCircle","payload":"touch start","socketid":"c-oJNdTcIs682LPcAABE","_msgid":"e2b5a0cb.a1e48"}
and
{"topic":"#myCircle","elementId":"myCircle","selector":"#myCircle","payload":"touch end","socketid":"c-oJNdTcIs682LPcAABE","_msgid":"46243e3c.ab013"}
Opposed to the mouse events, both messages do not contain the event object, which gives me no opportunity to move the spot light from my mobile ...
In addition, the click-event seems to be suppressed too.
Is there a specific reason why touch events do not deliver position events?
I wonder how I could work around this for my mobile device.
Help very much appreciated!
Best regards,
janosch