Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
New Member
Posts: 1
Registered: ‎09-09-2013
My Device: BlackBerry Z10
My Carrier: Telenor

MapView and onTouch not working in 10.2

[ Edited ]

Hey,

 

I have a simple MapView from which I need information when the user has started to pan the map and when the map was released. Prior to 10.2 i used the onTouch signal to get the event but it's no longer working for me in 10.2 and I can't for the life of me understand why that is. The release notes for 10.2 have been of no help. 

 

Example of what I'm trying to accomplish:

 

MapView {
   onTouch: {
      if (event.isDown() || event.touchType == TouchType.Down) {
         // Started panning
      } else if (event.isUp() || event.touchType = TouchType.Cancel) {
         // Ended panning
      }
   } 
}

 

Is there another way of getting these two events?

 

EDIT:

 

I might add that onTouchCapture, onTouchEnter and onTouchExit aren't working for me either.

 

 

Kind regards,

Fedza

 

 

 

Retired
Posts: 13
Registered: ‎08-30-2011
My Device: BlackBerry Q10
My Carrier: O2

Re: MapView and onTouch not working in 10.2

If you set touchPropagationMode: TouchPropagationMode.PassThrough, then the events should pass through to the parent node where you can catch the touches:

 

Page {

Container {

    layout: DockLayout {

    }

    MapView {

        touchPropagationMode: TouchPropagationMode.PassThrough

        horizontalAlignment: HorizontalAlignment.Fill

        verticalAlignment: VerticalAlignment.Fill

    }

    onTouch: {

        if (event.isDown() || event.touchType == TouchType.Down) {

            console.log("panning started!");

        } else if (event.isUp() || event.touchType == TouchType.Cancel) {

            console.log("panning ended!");

        }

    }

}

}