I am trying to pinch-zoom (and preferably double-click-zoom) an image on a mobile app (not a PWA). However, it seems as if this is turned off by the Cordova wrapper, since pinching an image does not zoom in. Are there any ways to make this work?
To enable pinch-zoom and double-click zoom functionality for images in an OutSystems mobile app, you can follow these steps:
Custom JavaScript Solution:
Cordova Plugin Integration:
Another approach is to integrate a Cordova plugin that specifically enables pinch-zoom functionality for images in your mobile app.
In your OutSystems app, create a custom action that will handle the pinch-zoom and double-click-zoom functionality. This action should use JavaScript to detect the pinch-zoom and double-click events and adjust the image size accordingly.
In the custom action, use the following code to detect the pinch-zoom and double-click events:
// Detect pinch-zoom
document.addEventListener('gesturestart', function(event) {
if (event.scale > 1) {
// Zoom in
} else {
// Zoom out
}
});
// Detect double-click
document.addEventListener('dblclick', function(event) {
if (event.target.tagName === 'IMG') {
// Toggle between zoomed-in and zoomed-out state
In the custom action, use the following code to adjust the image size:
function zoomIn() {
var img = event.target;
img.style.transform = 'scale(2)';
function zoomOut() {
img.style.transform = 'scale(1)';
In your OutSystems app, add the custom action to the image element where you want to enable pinch-zoom and double-click-zoom.
I have used and customized the Custom Touch Events extension, which uses Hammer JS, to achieve the desired result.