Spaces:
Running
Running
Dont allow panning view when certain annotation types are selected - fixes bug
Browse files- index.html +20 -0
index.html
CHANGED
@@ -113,6 +113,26 @@
|
|
113 |
}
|
114 |
});
|
115 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
</script>
|
117 |
</body>
|
118 |
</html>
|
|
|
113 |
}
|
114 |
});
|
115 |
});
|
116 |
+
|
117 |
+
// Disable panning when polygon tool is active
|
118 |
+
anno.on('startSelection', function(event) {
|
119 |
+
if (event.tool === 'polygon') {
|
120 |
+
viewer.setMouseNavEnabled(false);
|
121 |
+
}
|
122 |
+
});
|
123 |
+
|
124 |
+
// Re-enable panning when polygon tool is deactivated
|
125 |
+
anno.on('cancelSelection', function(event) {
|
126 |
+
if (event.tool === 'polygon') {
|
127 |
+
viewer.setMouseNavEnabled(true);
|
128 |
+
}
|
129 |
+
});
|
130 |
+
|
131 |
+
anno.on('createAnnotation', function(event) {
|
132 |
+
if (event.tool === 'polygon') {
|
133 |
+
viewer.setMouseNavEnabled(true);
|
134 |
+
}
|
135 |
+
});
|
136 |
</script>
|
137 |
</body>
|
138 |
</html>
|