vue-baidu-map-3x
Version:
vue-baidu-map的vue3版本(支持v2.0、v3.0和webGl api)。Baidu Map Component for Vue 3.0 (support v2.0 、 v3.0 and webGl api)
40 lines (35 loc) • 936 B
JavaScript
/**
* Author: yang jian fei
* Email: 1294485765@qq.com
* Created Date: Wednesday, April 20th 2022, 12:13:57 pm
* Modified By: yang jian fei
* Desc: desc
* Copyright (c) 2022 瑞为
*/
import { getConfig } from './util';
const config = getConfig();
const methods = {
'API': {
'2.0': {
setMapStyle: 'setMapStyle',
NavigationControl: 'NavigationControl'
},
'3.0': {
setMapStyle: 'setMapStyleV2',
NavigationControl: 'NavigationControl'
}
},
'WebGL': {
setMapStyle: 'setMapStyleV2',
NavigationControl: 'NavigationControl3D'
}
}
const getMapMethod = (method) => {
const config = getConfig();
if (config.type == 'WebGL') {
return methods[config.type][method];
} else {
return methods[config.type][config.v][method];
}
}
export default getMapMethod;