11import { extend } from '../../../core/util' ;
22
3+ const semiCircum = 6378137 * Math . PI ;
4+
35/**
46 * @classdesc
57 * A class internally used by tile layer helps to descibe tile system used by different tile services.<br>
@@ -20,6 +22,39 @@ class TileSystem {
2022 y : number ;
2123 }
2224
25+ /**
26+ * The most common used tile system, used by google maps, bing maps and amap, soso maps in China.
27+ * @see {@link https://en.wikipedia.org/wiki/Web_Mercator }
28+ * @constant
29+ * @static
30+ */
31+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
32+ static 'web-mercator' = new TileSystem ( [ 1 , - 1 , - semiCircum , semiCircum ] ) ;
33+
34+ /**
35+ * Predefined tile system for TMS tile system, A tile system published by [OSGEO]{@link http://www.osgeo.org/}. <br>
36+ * Also used by mapbox's [mbtiles]{@link https://github.com/mapbox/mbtiles-spec} specification.
37+ * @see {@link http://wiki.osgeo.org/wiki/Tile_Map_Service_Specification }
38+ * @constant
39+ * @static
40+ */
41+ static 'tms-global-mercator' = new TileSystem ( [ 1 , 1 , - semiCircum , - semiCircum ] ) ;
42+
43+ /**
44+ * Another tile system published by [OSGEO]{@link http://www.osgeo.org/}, based on EPSG:4326 SRS.
45+ * @see {@link http://wiki.osgeo.org/wiki/Tile_Map_Service_Specification#global-geodetic }
46+ * @constant
47+ * @static
48+ */
49+ static 'tms-global-geodetic' = new TileSystem ( [ 1 , 1 , - 180 , - 90 ] ) ;
50+
51+ /**
52+ * Tile system used by [baidu]{@link http://map.baidu.com}
53+ * @constant
54+ * @static
55+ */
56+ static 'baidu' = new TileSystem ( [ 1 , 1 , 0 , 0 ] ) ;
57+
2358 /**
2459 * Similar with [transformation]{@link Transformation}, it contains 4 numbers: sx, sy, ox, oy.<br>
2560 * @see {@link http://wiki.osgeo.org/wiki/Tile_Map_Service_Specification }
@@ -69,41 +104,4 @@ class TileSystem {
69104 }
70105}
71106
72- const semiCircum = 6378137 * Math . PI ;
73-
74- extend ( TileSystem , /** @lends TileSystem */ {
75- /**
76- * The most common used tile system, used by google maps, bing maps and amap, soso maps in China.
77- * @see {@link https://en.wikipedia.org/wiki/Web_Mercator }
78- * @constant
79- * @static
80- */
81- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
82- 'web-mercator' : new TileSystem ( [ 1 , - 1 , - semiCircum , semiCircum ] ) ,
83-
84- /**
85- * Predefined tile system for TMS tile system, A tile system published by [OSGEO]{@link http://www.osgeo.org/}. <br>
86- * Also used by mapbox's [mbtiles]{@link https://github.com/mapbox/mbtiles-spec} specification.
87- * @see {@link http://wiki.osgeo.org/wiki/Tile_Map_Service_Specification }
88- * @constant
89- * @static
90- */
91- 'tms-global-mercator' : new TileSystem ( [ 1 , 1 , - semiCircum , - semiCircum ] ) ,
92-
93- /**
94- * Another tile system published by [OSGEO]{@link http://www.osgeo.org/}, based on EPSG:4326 SRS.
95- * @see {@link http://wiki.osgeo.org/wiki/Tile_Map_Service_Specification#global-geodetic }
96- * @constant
97- * @static
98- */
99- 'tms-global-geodetic' : new TileSystem ( [ 1 , 1 , - 180 , - 90 ] ) ,
100-
101- /**
102- * Tile system used by [baidu]{@link http://map.baidu.com}
103- * @constant
104- * @static
105- */
106- 'baidu' : new TileSystem ( [ 1 , 1 , 0 , 0 ] )
107- } ) ;
108-
109107export default TileSystem ;
0 commit comments