File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -94,6 +94,11 @@ export default {
9494是否允许通过控制条切换子图,默认不允许。
9595只有在`show-toolbar`为`true`、当前地图存在多个子图且没有通过`lock-sub-id`锁定子图时,才会展示左右切换按钮。
9696
97+ ### auto-switch-sub-by-points
98+
99+ 是否允许组件根据传入点位自动推断子图,默认允许。
100+ 如果业务侧会临时隐藏、筛选或清空点位,但不希望当前子图因此改变,可以设为`false`。
101+
97102## 事件
98103
99104### map-move
Original file line number Diff line number Diff line change @@ -123,6 +123,10 @@ export default {
123123 type: Boolean ,
124124 default: false ,
125125 },
126+ autoSwitchSubByPoints: {
127+ type: Boolean ,
128+ default: true ,
129+ },
126130 },
127131 data : () => ({
128132 outerWidth: 0 ,
@@ -222,6 +226,7 @@ export default {
222226 if (! scales || this .subMaps .length <= 1 ) return 0 ;
223227 if (this .lockSubId != - 1 ) return this .lockSubId ;
224228 if (this .selectedSubId != null && scales[this .selectedSubId ]) return this .selectedSubId ;
229+ if (! this .autoSwitchSubByPoints ) return 0 ;
225230 let _sub = 0 ;
226231 let _subScale = 0 ;
227232 for (let sub in scales) {
@@ -343,6 +348,7 @@ export default {
343348 };
344349 },
345350 isPointsInRect (rect ) {
351+ if (! this .datas .length ) return false ;
346352 let points = this .datas .map ((p ) => {
347353 return {
348354 x: p .x ,
You can’t perform that action at this time.
0 commit comments