billpoards pickin on the tablet

Hello, wold someone help me please to tell how to make billboard points tochable on the ipad and another tablets.

I’m using mouse scenario:

var selected;

handler.setInputAction(function (movement) {

if (selected) {

//…

}

}, Cesium.ScreenSpaceEventType.LEFT_CLICK);

handler.setInputAction(

function (movement) {

selected = null;

var pickedObject = scene.pick(movement.endPosition);

if (Cesium.defined(pickedObject)) {

if (pickedObject.primitive._billboardCollection) {

selected = pickedObject.id;

//…

}

},

Cesium.ScreenSpaceEventType.MOUSE_MOVE

);

But how to make billboards touchable on the tablet?

Hello,

ScreenSpaceEventType.LEFT_CLICK should work for picking a billboard on a tablet.

Try this example:

var viewer = new Cesium.Viewer(‘cesiumContainer’, {
selectionIndicator : false,
infoBox : false
});
var scene = viewer.scene;

var entity = viewer.entities.add({
position : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
billboard : {
image : ‘…/images/Cesium_Logo_overlay.png’
}
});

// If the mouse is over the billboard, change its scale and color
var handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
handler.setInputAction(function(click) {
var pickedObject = scene.pick(click.position);
if (Cesium.defined(pickedObject) && (pickedObject.id === entity)) {
entity.billboard.scale = 2.0;
entity.billboard.color = Cesium.Color.YELLOW;
} else {
entity.billboard.scale = 1.0;
entity.billboard.color = Cesium.Color.WHITE;
}
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);

``

When you touch on the billboard, it should turn yellow. When you touch elsewhere it should turn white again. Let me know if that doesn’t work for you.

Best,

Hannah