点击左键如何设置ScreenSpaceEventHandler样式为十字光标
handler.setInputAction(function (evt) {
tooltip.showAt(evt.endPosition, '<p>点击左键选择标记的点</p>');
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
handler.setInputAction(function (evt) {
tooltip.setVisible(false);
handler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE);
}, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
handler.setInputAction(function (e) {
//获取点击位置笛卡尔坐标
var position = scene.pickPosition(e.position);
//将笛卡尔坐标转化为经纬度坐标
var cartographic = Cesium.Cartographic.fromCartesian(position);
var longitude = Cesium.Math.toDegrees(cartographic.longitude);
var latitude = Cesium.Math.toDegrees(cartographic.latitude);
var height = cartographic.height;
if (height < 0) {
height = 0;
}
//在点击位置添加对应点
viewer.entities.add(new Cesium.Entity({
position: Cesium.Cartesian3.fromDegrees(longitude, latitude, height),
billboard: {
image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACsAAAA+CAYAAACyRuLoAAANtElEQVRoQ+2ae3RU1bnAf/vMK5OEPHkkEyLysIqgoKCoyIWCUB+9l4UkE0Gt1VbRqgtary29aLW2Umx7tUXRImorLVUSFI0KqCBFqYhgeclDIi9JZngkJIQk8zrn7LvOmUdmMknIJPzTte7OmmTW2d/e+7e//e1vf/s7EfwbFdET1j7lssAGE6VgnCIZKmEwgmwk6YAPaERyCME+dP6JwjqPW3zT3TFTh10vrYW1lAnJXcB4wJLC4BL4TMBfbM0sPXyn8KfQlhRgpSiq4Hap80sE56cySHuyEo4JwXyP5HncQutKf12C7fu6HGxVeBUY25VOU5TZKeCOGrfYfrZ2Z4XtXyFv1iWvANntdaaf9KJ+vQe95hC69yi6rwU0FWGxgDMDpW8RluJBWAcPRelX1BGPX1qY7Z0uXuwMuFNYV4V8EMkfAKVtJ6HtmwhtWodedxwUxfwIERWToIOUxi8dqYf/KvkF2K+ehG3k1eE2bYqUzPeWiXkdAXcIGwFd2LahdugrAquWIxvrEVZb5GMNg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XRggF0uxN98HDkwGFttRm2ScGfakpF7HrVZc0agv2WygwljU0CLunQAGs9aIerkJ7DiNN1EApne8xcmBEAZedBv/MQBcXIPq6O7Rg2eWBCfLooJVhDuPh1OVhTMBJksXi3sxG7U2ek7EMORtVOFeGLXQelS3u4/3J5ow7vxOcVugPVQZuQFEzylgojIdhp6RKs0UPRcvmoFDxxtg5TrZcKs70lIilpnfIGS2ggpXBVmLHDf6UK1KG8ZJmnTNzW1f66rFmjw7xVMiutic+BC7s6QCdyO6jnGs8skZhP6qnNxrcvKJcXi/CLt149AD6lwejjbnEolT5S0my048g7h4rExHyXhzVubd/1uoURg6RUugVrjOAql78B2n2r0hmBhEe8bpGYwegicrdhKZcWF6wGJndxLEPsbU8p0+IjqRTaphQrJfVb9KbMlypb41P7nQz+lT/IldGUeyqQUdnuazbSg2uFvMx8PQ/OjgAknJFw1TG32NMdyHMGa3RUWC5vF7C0AxCpKJRWl4iEG0h3oHus2eigruVyIYIHkyAET3lK23+9mSrwOYNlsbS5cjFeooyLg1jrgeu7+v8EZ4M/d7BGWFYus52CF5GMF4IPg5L7TrpFJEFwNpSz159T2LMP1zOJ/4ftmf46bn1ONCuldFRXV18thLgI6C2l7CWEOC2lrFUU5UuXy/W5ECKSj+/+VHoEK6W0V1dX/yryDq2zKKxOCPF0UVHRAiFE5H1S6tA9gq2urn5ISpl0Xe8E49bi4uK/p44ZbtFT2JFSyg+APmcDEEIcsVgsEwoLC8OJ3G6UHsEa4x04cCDbZrPdJoSYbNislNKw2SxFURp0XTdtVtf1NVar9XWXy9XlW0F7c+kxbDcU1O0m/wcFaoO9AANDUQAAAABJRU5ErkJggg==',
width: 43,
height: 62,
},
}));
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);