@@ -68177,9 +68177,8 @@ window.proj4 = lib_default.a;
68177
68177
window.Proj4js = lib_default.a;
68178
68178
external_L_default.a.Proj = {};
68179
68179
68180
- external_L_default.a.Proj._isProj4Obj = function (a) {
68181
- return (typeof a.inverse !== 'undefined' &&
68182
- typeof a.forward !== 'undefined');
68180
+ external_L_default.a.Proj._isProj4Obj = function(a) {
68181
+ return typeof a.inverse !== 'undefined' && typeof a.forward !== 'undefined';
68183
68182
};
68184
68183
68185
68184
/**
@@ -68193,8 +68192,7 @@ external_L_default.a.Proj._isProj4Obj = function (a) {
68193
68192
* @param {L.bounds} bounds - 投影范围参数
68194
68193
*/
68195
68194
external_L_default.a.Proj.Projection = external_L_default.a.Class.extend({
68196
-
68197
- initialize: function (code, def, bounds) {
68195
+ initialize: function(code, def, bounds) {
68198
68196
var isP4 = external_L_default.a.Proj._isProj4Obj(code);
68199
68197
this._proj = isP4 ? code : this._projFromCodeDef(code, def);
68200
68198
var boundsOption = bounds;
@@ -68210,7 +68208,7 @@ external_L_default.a.Proj.Projection = external_L_default.a.Class.extend({
68210
68208
* @param {L.Latlng} latlng - 经纬度坐标。
68211
68209
* @returns {L.Point} 返回投影坐标点。
68212
68210
*/
68213
- project: function (latlng) {
68211
+ project: function(latlng) {
68214
68212
var point = this._proj.forward([latlng.lng, latlng.lat]);
68215
68213
return new external_L_default.a.Point(point[0], point[1]);
68216
68214
},
@@ -68222,16 +68220,26 @@ external_L_default.a.Proj.Projection = external_L_default.a.Class.extend({
68222
68220
* @param {number} unbounded - 坐标点高程值等。
68223
68221
* @returns {L.LatLng} 返回经纬度坐标
68224
68222
*/
68225
- unproject: function (point, unbounded) {
68223
+ unproject: function(point, unbounded) {
68226
68224
if (this.bounds) {
68227
- point.x = point.x < this.bounds.min.x ? this.bounds.min.x : (point.x > this.bounds.max.x ? this.bounds.max.x : point.x);
68228
- point.y = point.y < this.bounds.min.y ? this.bounds.min.y : (point.y > this.bounds.max.y ? this.bounds.max.y : point.y);
68225
+ point.x =
68226
+ point.x < this.bounds.min.x
68227
+ ? this.bounds.min.x
68228
+ : point.x > this.bounds.max.x
68229
+ ? this.bounds.max.x
68230
+ : point.x;
68231
+ point.y =
68232
+ point.y < this.bounds.min.y
68233
+ ? this.bounds.min.y
68234
+ : point.y > this.bounds.max.y
68235
+ ? this.bounds.max.y
68236
+ : point.y;
68229
68237
}
68230
68238
var point2 = this._proj.inverse([point.x, point.y]);
68231
68239
return new external_L_default.a.LatLng(point2[1], point2[0], unbounded);
68232
68240
},
68233
68241
68234
- _projFromCodeDef: function (code, def) {
68242
+ _projFromCodeDef: function(code, def) {
68235
68243
if (def) {
68236
68244
lib_default.a.defs(code, def);
68237
68245
} else if (lib_default.a.defs[code] === undefined) {
@@ -68246,8 +68254,8 @@ external_L_default.a.Proj.Projection = external_L_default.a.Class.extend({
68246
68254
68247
68255
return lib_default()(code);
68248
68256
},
68249
- getUnits: function () {
68250
- return this._proj.oProj.units || " degrees" ;
68257
+ getUnits: function() {
68258
+ return this._proj.oProj.units || ' degrees' ;
68251
68259
}
68252
68260
});
68253
68261
@@ -68286,7 +68294,7 @@ var Proj4Leaflet_CRS = external_L_default.a.Class.extend({
68286
68294
transformation: new external_L_default.a.Transformation(1, 0, -1, 0)
68287
68295
},
68288
68296
68289
- initialize: function (srsCode, options) {
68297
+ initialize: function(srsCode, options) {
68290
68298
var code, proj, def;
68291
68299
68292
68300
if (external_L_default.a.Proj._isProj4Obj(srsCode)) {
@@ -68305,7 +68313,7 @@ var Proj4Leaflet_CRS = external_L_default.a.Class.extend({
68305
68313
external_L_default.a.Util.setOptions(this, options);
68306
68314
this.code = code;
68307
68315
this.transformation = this.options.transformation;
68308
- this.options.dpi= this.options.dpi|| 96;
68316
+ this.options.dpi = this.options.dpi || 96;
68309
68317
if (this.options.bounds) {
68310
68318
this.options.bounds = external_L_default.a.bounds(this.options.bounds);
68311
68319
}
@@ -68316,8 +68324,7 @@ var Proj4Leaflet_CRS = external_L_default.a.Class.extend({
68316
68324
if (this.options.origin instanceof external_L_default.a.Point) {
68317
68325
this.options.origin = [this.options.origin.x, this.options.origin.y];
68318
68326
}
68319
- this.transformation =
68320
- new external_L_default.a.Transformation(1, -this.options.origin[0], -1, this.options.origin[1]);
68327
+ this.transformation = new external_L_default.a.Transformation(1, -this.options.origin[0], -1, this.options.origin[1]);
68321
68328
}
68322
68329
68323
68330
if (this.options.scales && this.options.scales.length > 0) {
@@ -68341,9 +68348,8 @@ var Proj4Leaflet_CRS = external_L_default.a.Class.extend({
68341
68348
}
68342
68349
this._rectify();
68343
68350
this.infinite = !this.options.bounds;
68344
-
68345
68351
},
68346
- _rectify: function () {
68352
+ _rectify: function() {
68347
68353
if (this._scales) {
68348
68354
if (!this.resolutions) {
68349
68355
this.resolutions = [];
@@ -68352,7 +68358,11 @@ var Proj4Leaflet_CRS = external_L_default.a.Class.extend({
68352
68358
if (!this.scales) {
68353
68359
this.scales = [];
68354
68360
for (let i = 0; i < this.resolutions.length; i++) {
68355
- var scaleD = this.resolutions[i] * this.options.dpi * (1 / 0.0254) * this._getMeterPerMapUnit(this.projection.getUnits());
68361
+ var scaleD =
68362
+ this.resolutions[i] *
68363
+ this.options.dpi *
68364
+ (1 / 0.0254) *
68365
+ this._getMeterPerMapUnit(this.projection.getUnits());
68356
68366
this.scales[i] = 1.0 / scaleD;
68357
68367
}
68358
68368
}
@@ -68364,7 +68374,7 @@ var Proj4Leaflet_CRS = external_L_default.a.Class.extend({
68364
68374
* @param {number} zoom - 缩放级别。
68365
68375
* @returns 比例尺值。
68366
68376
*/
68367
- scale: function (zoom) {
68377
+ scale: function(zoom) {
68368
68378
var iZoom = Math.floor(zoom),
68369
68379
baseScale,
68370
68380
nextScale,
@@ -68377,7 +68387,7 @@ var Proj4Leaflet_CRS = external_L_default.a.Class.extend({
68377
68387
baseScale = this._scales[iZoom];
68378
68388
nextScale = this._scales[iZoom + 1];
68379
68389
scaleDiff = nextScale - baseScale;
68380
- zDiff = ( zoom - iZoom) ;
68390
+ zDiff = zoom - iZoom;
68381
68391
return baseScale + scaleDiff * zDiff;
68382
68392
}
68383
68393
},
@@ -68388,22 +68398,25 @@ var Proj4Leaflet_CRS = external_L_default.a.Class.extend({
68388
68398
* @param {number} scale - 比例尺。
68389
68399
* @returns {number} 缩放级别。
68390
68400
*/
68391
- zoom: function (scale) {
68401
+ zoom: function(scale) {
68392
68402
// Find closest number in this._scales, down
68393
68403
var downScale = this._closestElement(this._scales, scale),
68394
68404
downZoom = this._scales.indexOf(downScale),
68395
68405
nextScale,
68396
68406
nextZoom,
68397
68407
scaleDiff;
68398
68408
// Check if scale is downScale => return array index
68409
+ if (!downScale) {
68410
+ return 0;
68411
+ }
68399
68412
if (scale === downScale) {
68400
68413
return downZoom;
68401
68414
}
68402
68415
// Interpolate
68403
68416
nextZoom = downZoom + 1;
68404
68417
nextScale = this._scales[nextZoom];
68405
68418
if (nextScale === undefined) {
68406
- return Infinity ;
68419
+ return downZoom ;
68407
68420
}
68408
68421
scaleDiff = nextScale - downScale;
68409
68422
return (scale - downScale) / scaleDiff + downZoom;
@@ -68414,9 +68427,9 @@ var Proj4Leaflet_CRS = external_L_default.a.Class.extend({
68414
68427
R: external_L_default.a.CRS.Earth.R,
68415
68428
68416
68429
/* Get the closest lowest element in an array */
68417
- _closestElement: function (array, element) {
68430
+ _closestElement: function(array, element) {
68418
68431
var low;
68419
- for (var i = array.length; i--;) {
68432
+ for (var i = array.length; i--; ) {
68420
68433
if (array[i] <= element && (low === undefined || low < array[i])) {
68421
68434
low = array[i];
68422
68435
}
@@ -68432,9 +68445,8 @@ var Proj4Leaflet_CRS = external_L_default.a.Class.extend({
68432
68445
resolutions[i] = 1.0 / _scales[i];
68433
68446
}
68434
68447
return resolutions;
68435
-
68436
68448
},
68437
- _toProj4Scales: function (scales, dpi) {
68449
+ _toProj4Scales: function(scales, dpi) {
68438
68450
var proj4Scales = [];
68439
68451
if (!scales) {
68440
68452
return proj4Scales;
@@ -68445,24 +68457,24 @@ var Proj4Leaflet_CRS = external_L_default.a.Class.extend({
68445
68457
}
68446
68458
return proj4Scales;
68447
68459
},
68448
- _getMeterPerMapUnit: function (mapUnit) {
68460
+ _getMeterPerMapUnit: function(mapUnit) {
68449
68461
var earchRadiusInMeters = 6378137;
68450
68462
var meterPerMapUnit = 1;
68451
- if (mapUnit === " meter" ) {
68463
+ if (mapUnit === ' meter' ) {
68452
68464
meterPerMapUnit = 1;
68453
- } else if (mapUnit === " degrees" ) {
68465
+ } else if (mapUnit === ' degrees' ) {
68454
68466
// 每度表示多少米。
68455
- meterPerMapUnit = Math.PI * 2 * earchRadiusInMeters / 360;
68456
- } else if (mapUnit === " kilometer" ) {
68457
- meterPerMapUnit = 1.0E -3;
68458
- } else if (mapUnit === " inch" ) {
68459
- meterPerMapUnit = 1 / 2.5399999918E -2;
68460
- } else if (mapUnit === " feet" ) {
68467
+ meterPerMapUnit = ( Math.PI * 2 * earchRadiusInMeters) / 360;
68468
+ } else if (mapUnit === ' kilometer' ) {
68469
+ meterPerMapUnit = 1.0e -3;
68470
+ } else if (mapUnit === ' inch' ) {
68471
+ meterPerMapUnit = 1 / 2.5399999918e -2;
68472
+ } else if (mapUnit === ' feet' ) {
68461
68473
meterPerMapUnit = 0.3048;
68462
68474
}
68463
68475
return meterPerMapUnit;
68464
68476
},
68465
- _getDefaultProj4ScalesByBounds: function (bounds) {
68477
+ _getDefaultProj4ScalesByBounds: function(bounds) {
68466
68478
if (!bounds) {
68467
68479
return [];
68468
68480
}
@@ -68477,10 +68489,11 @@ var Proj4Leaflet_CRS = external_L_default.a.Class.extend({
68477
68489
return scales;
68478
68490
}
68479
68491
});
68480
- var Proj4Leaflet_crs = function (srsCode, options) {
68481
- return new Proj4Leaflet_CRS(srsCode, options)
68492
+ var Proj4Leaflet_crs = function(srsCode, options) {
68493
+ return new Proj4Leaflet_CRS(srsCode, options);
68482
68494
};
68483
68495
external_L_default.a.Proj.CRS = Proj4Leaflet_crs;
68496
+
68484
68497
// CONCATENATED MODULE: ./src/leaflet/core/ExtendsCRS.js
68485
68498
/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved.
68486
68499
* This program are made available under the terms of the Apache License, Version 2.0
0 commit comments