bmh_cesium/public/widgets/toolbtn-zoom/widget.js
2025-03-10 07:23:50 +08:00

56 lines
1.2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//此方式弹窗非iframe模式
xjsdk.widget.bindClass(xjsdk.widget.BaseWidget.extend({
options: {
//弹窗
view: {
type: "append",
url: "view.html",
parent: ".cesium-viewer-toolbar"
},
},
//初始化[仅执行1次]
create: function () {
},
//每个窗口创建完成后调用
winCreateOK: function (opt, result) {
//此处可以绑定页面dom事件
//修改当前插件中按钮顺序到home按钮后面
$(".cesium-home-button").after($(opt._dom));
//修改导航球
var height = $(".cesium-viewer-toolbar").height() + 40;
$(".compass").css({ "bottom": height + "px" });
//工具按钮菜单事件
var zoomIn = new xjsdk.ZoomNavigation(this.viewer, true);
$("#btn-zommIn").click(function () {
zoomIn.activate();
});
var zoomOut = new xjsdk.ZoomNavigation(this.viewer, false);
$("#btn-ZoomOut").click(function () {
zoomOut.activate();
});
},
//激活插件
activate: function () {
},
//释放插件
disable: function () {
},
}));