forked from huiyan-fe/mapv
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMapv.js
More file actions
47 lines (40 loc) · 1.04 KB
/
Mapv.js
File metadata and controls
47 lines (40 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/**
* @author nikai (@胖嘟嘟的骨头, nikai@baidu.com)
* 地图可视化库,目前依赖与百度地图api,在百度地图api上展示点数据
*
*/
/**
* Mapv主类
* @param {Object}
*/
function Mapv(options) {
Class.call(this);
this.initOptions($.extend({
map: null, //地图参数
drawTypeControl: false,
drawTypeControlOptions: {
a: 1
}
}, options));
this._layers = [];
this._initDrawScale();
this.notify('drawTypeControl');
}
util.inherits(Mapv, Class);
Mapv.prototype._initDrawScale = function () {
this.Scale = new DrawScale();
};
Mapv.prototype.drawTypeControl_changed = function () {
if (this.getDrawTypeControl()) {
if (!this.drawTypeControl) {
this.drawTypeControl = new DrawTypeControl({
mapv: this
});
}
this.getMap().addControl(this.drawTypeControl);
} else {
if (this.drawTypeControl) {
this.getMap().removeControl(this.drawTypeControl);
}
}
}