new IWTouchUtils()
Methods
-
addTouchGestures(map)
-
Adds default touch behaviour to the map. This depends on the default behaviour set by
IWTouchUtils.setTouchOptions()
.Parameters:
Name Type Description map
IWMap a map Returns:
- Type
- void
-
isTouchScreenAvailable()
-
Checks whether touch gestures supported by the map are available on the device or not.
Returns:
- Type
- boolean
-
setTouchOptions(map, options)
-
Sets some options regarding touch gestures. Supported options:
Property Description Value Default reloadOnMove reload tiles during map movements (slower) boolean false preventDefault Prevent default browser behavior for touch gestures (i.e. scrolling or zooming the page) boolean true defaultBehaviour.tap toggles default behaviour for tap events boolean true defaultBehaviour.twoFingerTap toggles default behaviour for two finger tap events boolean true defaultBehaviour.doubleTap toggles default behaviour for double tap events boolean true defaultBehaviour.drag toggles default behaviour for drag events boolean true defaultBehaviour.transform toggles default behaviour for transform events boolean true Example:
var options = { reloadOnMove: false, defaultBehaviour: { tap: false, twoFingerTap: false, doubleTap: false, drag: true, transform: true } }; IWTouchUtils.setTouchOptions(options); IWTouchUtils.addTouchGestures(map); IWEventManager.addCustomListener(map, 'ontap', function(event) { // implement own tap event handler here });
Parameters:
Name Type Description map
IWMap a map options
object a set of options as defined above Returns:
- Type
- void