ArcGIS API for JavaScript 4.17量测控件的默认样式是否可以修改呢?
使用"esri/widgets/Measurement"这个API模块实现了距离测量和面积测量的功能,目前功能正常使用,但是控件自带的黄白相间这个样式有点不太好看,想自定义样式,不知道是否可行呢?
我自己在实例化的时候用“declaredClass”属性指定了自定义类名,但是发现没起作用,代码和目前效果如下:
我自己在实例化的时候用“declaredClass”属性指定了自定义类名,但是发现没起作用,代码和目前效果如下:
// 距离测量
distanceMeasureMent() {
const _self = this
loadModules(['esri/widgets/Measurement'], options)
.then(([Measurement]) => {
if (_self.measurement) {
_self.measurement.destroy()
}
_self.measurement = new Measurement({
declaredClass: 'lineStyle',
})
_self.mainView.ui.add(_self.measurement, 'bottom-right')
_self.measurement.view = this.mainView
_self.measurement.activeTool = 'distance'
})
.catch((err) => {
// eslint-disable-next-line no-console
console.log('距离测量工具创建失败,' + err)
})
},
3 个回复
谢军
赞同来自: 北 、zjez126
木东_318
赞同来自:
anhuixbn
赞同来自:
要回复问题请先登录或注册
发起人
一名什么都想搞一些的GISer
相关问题
问题状态