优化地图 区域变化时地图核心跟随调整

This commit is contained in:
cloud 2020-12-30 21:07:18 +08:00
parent 1a3cf99c5f
commit 7b1246a856
2 changed files with 12 additions and 12 deletions

View File

@ -377,10 +377,7 @@ var APPMAP;
_this.watch(_this, 'selectProv', function () {
_this.filter();
});
_this.watch(_this, 'selectCity', function () {
_this.filter();
});
_this.watch(_this, 'selectDist', function () {
_this.watch(_this, 'allCity', function () {
_this.filter();
});
$('#selectMapId').on('shown.bs.modal', function () {
@ -644,8 +641,11 @@ var APPMAP;
inputVid.trigger('change');
};
selectMap.prototype.filter = function () {
var vtype = $('select[name="vtype"]').val();
var vtype;
if ($('select[name="vtype"]').length) {
vtype = $('select[name="vtype"]').val();
vtype = vtype ? vtype.join(',') : '';
}
$('#selectMapId .mapreset').trigger('click');
this.selectMap.clearOverlays();
this.ajaxlnglatList(this.selectMap, {

View File

@ -533,10 +533,7 @@ namespace APPMAP {
this.watch(this, 'selectProv', () => {
this.filter()
})
this.watch(this, 'selectCity', () => {
this.filter()
})
this.watch(this, 'selectDist', () => {
this.watch(this, 'allCity', () => {
this.filter()
})
@ -904,8 +901,11 @@ namespace APPMAP {
// 根据条件筛选小区
filter() {
// 获取指定的值
let vtype = $('select[name="vtype"]').val()
let vtype:any
if($('select[name="vtype"]').length){
vtype = $('select[name="vtype"]').val()
vtype = vtype ? vtype.join(',') : ''
}
// 需要将缓存全部删除掉
$('#selectMapId .mapreset').trigger('click')
//清除标注