bubble.qml Example File
custommapview/assets/bubble.qml
import bb.cascades 1.0
Container {
property string bubbleImageSource: "asset:///images/bubble.png"
property int pointerOffsetX: 135
property int pointerOffsetY: 180
property int pinWidth: 60
property int pinHeight: 60
property int contentWidth: 439
property int contentHeight: 125
property int padding: 10
property int x: 0
property int y: 0
property int actualX: x - pointerOffsetX
property int actualY: y - pointerOffsetY - pinHeight
property double lat
property double lon
overlapTouchPolicy: OverlapTouchPolicy.Allow
layoutProperties: AbsoluteLayoutProperties {
id: position
positionX: actualX
positionY: actualY
}
layout: DockLayout {
}
ImageView {
imageSource: bubbleImageSource
overlapTouchPolicy: OverlapTouchPolicy.Allow
}
Container {
topPadding: padding
leftPadding: padding
rightPadding: padding
preferredHeight: contentHeight
preferredWidth: contentWidth
maxHeight: contentHeight
maxWidth: contentWidth
overlapTouchPolicy: OverlapTouchPolicy.Allow
layout: DockLayout {
}
Label {
horizontalAlignment: HorizontalAlignment.Left
verticalAlignment: VerticalAlignment.Center
overlapTouchPolicy: OverlapTouchPolicy.Allow
text: qsTr("Hey, Lets go!")
textStyle.color: Color.White
multiline: true
}
Button {
preferredWidth: 50
horizontalAlignment: HorizontalAlignment.Right
verticalAlignment: VerticalAlignment.Center
overlapTouchPolicy: OverlapTouchPolicy.Allow
imageSource: "asset:///images/url.png"
}
}
animations: [
ParallelAnimation {
id: anim
ScaleTransition {
fromX: 0
toX: 1
fromY: 0
toY: 1
duration: 300
easingCurve: StockCurve.BounceOut
}
FadeTransition {
fromOpacity: 0
toOpacity: 1
duration: 200
}
}
]
function play() {
anim.play();
}
}