Hi,
that is maybe a bad question, but is it possible to disable picking of buildings for a complete 3dTileset ?
For example: i want to do same measurement and anytime i pick a point the infobox of a building is shown.
Regards
Rüdiger
Hi,
that is maybe a bad question, but is it possible to disable picking of buildings for a complete 3dTileset ?
For example: i want to do same measurement and anytime i pick a point the infobox of a building is shown.
Regards
Rüdiger
Well, you can do that yourself, no? If you click the measurement button (or however you start it), you stop the picking apart from the position picking?
Hard to pinpoint what to do without knowing how you’ve created your application. There’s also the further item of whether you’re using pick() or drillPick(), as with the latter you can filter out results.
Cheers,
Alex
the measurement was only an example - i would like to prevent the picking of building information on a 3dTileset of osm-buildings
Rüdiger
Hi,
Sorry, but you have to give us a bit more info. In what context do you mean disable picking? Given that Cesium is a JS library with an API for making geospatial apps, I’m assuming that’s what you’ve done? Made an app? Or are you using something like Cesium Ion viewer? Or a sandcastle example?
Cheers,
Alex
Hi @Ruediger_Brand,
if I understand you correctly, you want to disable the InfoBox or selection of models during some self made functionality like measurement/drawing on terrain e.g. ?
If so, then you could build the selection/information with your own ScreenSpaceEventHandler
and destroy it at the start of the other functionality with somthing like VARIABLEOFYOURHANDLER.destroy();
. You could reinitiate it later, when the user finished e.g. measurement/drawing.
If that’s not what you want, please give us some more information, as @Alexander_Johannesen already stated.
Best, Lennart
@lennart.imberg @Alexander_Johannesen
Hi Lennart, Alexander,
it is not so complicated - I would like to disable the selection / showing the infobox for a whole 3d-tileset of osm/citygml-buildings.
My user wants to see the buildings, but no further information on click.
Regards
Rüdiger
Ps: in your case - what screenspaceeventhandler should I destroy ?
@lennart.imberg @Alexander_Johannesen
hi,
here is a very basic sandcastle, if i pick a building I get the info box - how can I disable that ?
Don’t know. I never use the infoBox myself (I configure the viewer with “infoBox:false”) as I’ve got my own UI and methods for displaying selected items. I looked for options to control the picking manually, but couldn’t really find much. One way you could do it would be to write an additional mouse handler for mouse clicks and return false when you’re in your non-picking mode, that might overwrite the internal Cesium handler.
Cheers,
Alex
HI @Ruediger_Brand,
if you want to disable the Infobox for specific tilesets, but enable it for other tilesets, you can create your own ScreenSpaceEventHandler (listening to left mouse click e.g.) und use the tilesets url in an if-else-statement:
// Create and define own ScreenSpaceEventHandler
let selectionhandler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);
selectionhandler.setInputAction(function onLeftClick (movement) {
// pick a feature
const pickedFeature = viewer.scene.pick(movement.position);
// specify your if-else-condition
const condition = 'URL OF SPECIFIC TILESET'
if (pickedFeature.tileset._url === condition) {
viewer.selectedEntity = null;
}
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
If you want to disable ht Infobox for the whole App use the solution Alexander posted.
Best, Lennart
EDIT: if you want to get the url of some ionAssets you can use following code
const url = await Cesium.IonResource.fromAssetId('IonID').then(
function (response){
return response._url
}
);
or just use https://assets.cesium.com/{ION_ID}/tileset.json
@lennart.imberg @Alexander_Johannesen
Hi,
this works - maybe it could be an improvement, to set a flag at the Tileset-constructor options, like the enablePickFeatures in the Cesium.ArcGisMapServerImageryProvider.
I don’t know your implementation, but I think with this screenspacehandler InputAction I overwrite a default behaviour of the tileset - so something similar must exist, which now is out of order.
Regards
Rüdiger