你的浏览器禁用了JavaScript, 请开启后刷新浏览器获得更好的体验!
输入关键字进行搜索
醉里挑灯看剑
赞同来自: 许丹石
知名不具
赞同来自:
朱云峰Yvan
swaggyP - 网络粉刷匠
要回复问题请先登录或注册
4 个回复
醉里挑灯看剑
赞同来自: 许丹石
view.on("mouse-wheel", function(event) {
var num = view.scale;
console.log(num);
});
前提:事先在view初始化的时候,添加scale属性,不然获取不到比例尺,
var view = new MapView({
container: "viewDiv",
map: map,
zoom: 4,
scale: 24000,
center: [15, 65]
});
随着鼠标滚轮滑动,比例尺也变动。
知名不具
赞同来自:
朱云峰Yvan
赞同来自:
var scaleBar = new ScaleBar({
view: view,
unit: 'metric' //单位km,默认mile
});
// Add widget to the bottom left corner of the view
view.ui.add(scaleBar, {
position: "bottom-left"
});
swaggyP - 网络粉刷匠
赞同来自:
要回复问题请先登录或注册
发起人
相关问题
问题状态