palce billboards and labels on the globe.
then when i click on them, go to any website.
how can i make this happen?
thanks:)
is there any way you could help me out here?
just the block youve described would be fine :)
thanky again :):):)
--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
i'll post on the success!
thank you :)
i create the billboard, say:
//Google
var billboard = billboards.add({
position : ellipsoid.cartographicToCartesian(Cesium.Cartographic.fromDegrees(-105.270546, 40.014986)),
imageIndex : 0});
billboard.linkForPick = 'http://www.google.com/intl/de/about';
and the i do this
var handler = new Cesium.ScreenSpaceEventHandler(scene.getCanvas());
handler.setInputAction(function(movement) {
"use strict";
var pickedObject = scene.pick(movement.position);
if (typeof pickedObject !== 'undefined' && typeof pickedObject.linkForPick !== 'undefined') {
window.open(pickedObject.linkForPick, '_self');
}
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
scene.getPrimitives().add(labels);}
it runs a bit jaggy, but okay :)
what i then did was call this html site in another html site via iframe,
so i have an overlay logio, that remains on top even on external sites,
so ican always come back to my locally hosted globe.
exactly what i want.
thakns all :)
Thank you for your kind help in correcting the code. Now it works perfect with planes too :) I do really appreciate your help.
One more thing I'm trying to invent, but due to lack of technical background, I can't obtain the effect by myself :(
What I would like to achieve is to join 2 functions: "click plane and open url" and "slight change size of plane, when mouse is over" That would encourage potential user to click on plane.
Here's the code I tried to adapt from sandcastle. I paste it below in full version to avoid deleting the message by admin.
If you would be so kind, share your experience, have a look and correct the code below, you would make me fully happy, and let me finish the dream globe widget on my website :) Thank you in advance !
var viewer = new Cesium.Viewer('cesiumContainer');
var scene = viewer.scene;
var plane = viewer.entities.add({
position: Cesium.Cartesian3.fromDegrees(18.0, 53.0, 500000.0),
plane : {
plane : new Cesium.Plane(Cesium.Cartesian3.UNIT_Z, 0.0),
dimensions : new Cesium.Cartesian2(1600000.0, 1200000.0),
material : '../images/Cesium_Logo_overlay.png',
outline : true,
outlineColor : Cesium.Color.BLACK
}
});
plane.linkForPick = 'https://www.google.com/';
viewer.screenSpaceEventHandler.setInputAction(function(mouse) {
var pickedObject = viewer.scene.pick(mouse.position);
if (Cesium.defined(pickedObject) && Cesium.defined(pickedObject.id.linkForPick)) {
window.open(pickedObject.id.linkForPick);
}
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
var handler;
handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
handler.setInputAction(function(movement) {
var pickedObject = viewer.scene.pick(movement.endPosition);
if (Cesium.defined(pickedObject) && (pickedObject.id === plane)) {
plane.scale = 2.0;
} else {
plane.scale = 1.0;
}
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
Thank you for your kind help!
Finally I have what I planned to do :)