forked from SuperMap/iClient-JavaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBase.js
More file actions
47 lines (42 loc) · 1.32 KB
/
Base.js
File metadata and controls
47 lines (42 loc) · 1.32 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
/* Copyright© 2000 - 2018 SuperMap Software Co.Ltd. All rights reserved.
* This program are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
/**
* @namespace L
* @category BaseTypes Namespace
*/
/**
* @namespace L.supermap
* @category BaseTypes Namespace
*/
/**
* SuperMap Leaflet基类
* 定义命名空间
* 提供公共模块
*/
import L from "leaflet";
import './NonEarthCRS';
import './Proj4Leaflet';
import './ExtendsCRS';
import Attributions from './Attributions';
L.supermap = L.supermap || {};
L.supermap.control = L.supermap.control || {};
L.supermap.widgets = L.supermap.widgets || {};
L.Control.Attribution.include({
options: {
position: 'bottomright',
prefix: Attributions.Prefix
}
});
wrapToGeoJSON([L.Polyline, L.Polygon, L.Marker, L.CircleMarker, L.Circle, L.LayerGroup]);
function wrapToGeoJSON(objClassArray) {
objClassArray.map((objClass) => {
objClass.defaultFunction = objClass.prototype.toGeoJSON;
objClass.include({
toGeoJSON: function (precision) {
return objClass.defaultFunction.call(this, precision || 10);
}
})
return objClass;
})
}