CameraPopoverOptions

iOS-only parameters that specify the anchor element location and arrow direction of the popover when selecting images from an iPad's library or album.

{ x : 0,
  y :  32,
  width : 320,
  height : 480,
  arrowDir : Camera.PopoverArrowDirection.ARROW_ANY
};

CameraPopoverOptions

  • x: x pixel coordinate of screen element onto which to anchor the popover. (Number)

  • y: y pixel coordinate of screen element onto which to anchor the popover. (Number)

  • width: width, in pixels, of the screen element onto which to anchor the popover. (Number)

  • height: height, in pixels, of the screen element onto which to anchor the popover. (Number)

  • arrowDir: Direction the arrow on the popover should point. Defined in [Camera](../camera.html).PopoverArrowDirection (Number)

          Camera.PopoverArrowDirection = {
              ARROW_UP : 1,        // matches iOS UIPopoverArrowDirection constants
              ARROW_DOWN : 2,
              ARROW_LEFT : 4,
              ARROW_RIGHT : 8,
              ARROW_ANY : 15
          };
    

Note that the size of the popover may change to adjust to the direction of the arrow and orientation of the screen. Make sure to account for orientation changes when specifying the anchor element location.

Quick Example

 var popover = new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY);
 var options = {
     quality         : 50,
     destinationType : Camera.DestinationType.DATA_URL,
     sourceType      : Camera.PictureSource.SAVEDPHOTOALBUM,
     popoverOptions  : popover
 };

 navigator.camera.getPicture(onSuccess, onFail, options);

 function onSuccess(imageData) {
     var image = document.getElementById('myImage');
     image.src = "data:image/jpeg;base64," + imageData;
 }

 function onFail(message) {
     alert('Failed because: ' + message);
 }