Hi there.
New to OSD and loving it so far :-)
I have a problem where I'm trying to click on overlay on my map (which is a button), but the clicks aren't registering on iOS. They work fine in desktop. I've had a look through the issues here, but can't seem to find a resolution that works for me.
My javascript / jquery is poor at best
I've tried adding the cursor: pointer; style to the button
<input type="button" id="example-overlay2" class="highlight" style="display:none; cursor: pointer;" onclick="result();" value="clickme">
I've also tried removing the onclick above, and handling clicks in the DOM
document.getElementById("example-overlay").addEventListener("click", result);
But neither seem to be working...
FYI I've also diasbled zoom on click/touch using viewinputhook.min.js
viewer.addViewerInputHook({hooks: [
// Disable zoom on click/touch
{tracker: 'viewer', handler: 'clickHandler', hookHandler: function (event) {if (event.quick) {event.preventDefaultAction = true;}}}
]});
Any ideas? I'm obviously doing something very basic wrong!
Thanks
Oli
Because of the complicated event tracking OSD needs, we recommend using the MouseTracker for overlay clicks. Here's an example:
http://codepen.io/iangilman/pen/mEkKaY
Hopefully that will sort out the iOS issue!
I'm facing a similar issue. @iangilman 's answer is still the best solution?
Yes, this is still the best solution. I believe @msalsbery may be working on additional fixes, but nothing is ready yet.