Skip to content

Commit 5a07dee

Browse files
committed
【fix/feature】修复leaflet平面无投影在手机上访问双指放大缩小可能的错乱问题 jsdoc目录增加版本标识
1 parent daf2216 commit 5a07dee

File tree

8 files changed

+31
-28
lines changed

8 files changed

+31
-28
lines changed

build/jsdocs/template/publish.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ function buildNavMap(members) {
297297
nav = {
298298
type: 'namespace',
299299
longname: v.longname,
300+
version:v.version,
300301
name: v.name,
301302
members: find({
302303
kind: 'member',
@@ -321,6 +322,7 @@ function buildNavMap(members) {
321322
type: 'class',
322323
longname: v.longname,
323324
name: v.name,
325+
version:v.version,
324326
members: find({
325327
kind: 'member',
326328
memberof: v.longname

build/jsdocs/template/tmpl/navigation.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ function buildLi(obj){
110110

111111
obj.methods.forEach(function (v) {
112112
?>
113-
<li data-name="<?js= v.longname ?>"><?js= self.linkto(v.longname, v.name) ?></li>
113+
<li data-version= "<?js= v.version||obj.version ?>" data-name="<?js= v.longname ?>"><?js= self.linkto(v.longname, v.name) ?></li>
114114
<?js
115115
});
116116
}

dist/leaflet/iclient9-leaflet-es6.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64938,6 +64938,7 @@ SuperMap.Widgets.ChartViewModel = ChartViewModel_ChartViewModel;
6493864938
/**
6493964939
* @class SuperMap.Widgets.ChartView
6494064940
* @classdesc 图表微件
64941+
* @version 9.1.1
6494164942
* @param {string} domID - 图表dom元素ID。
6494264943
* @param {Object} options - 可选参数。
6494364944
* @param {string} options.type - 图表类型。
@@ -67083,10 +67084,10 @@ var NonEarthCRS = external_L_default.a.Class.extend({
6708367084
scale: function (zoom) {
6708467085
if (!this.resolutions || this.resolutions.length === 0) {
6708567086
var width = Math.max(this.bounds.getSize().x, this.bounds.getSize().y);
67086-
var defaultScale = 1 / (width / 256);
67087+
var defaultScale = 1.0 / (width / 256);
6708767088
return defaultScale * Math.pow(2, zoom);
6708867089
}
67089-
return 1 / this.resolutions[zoom];
67090+
return 1.0 / this.resolutions[zoom];
6709067091
},
6709167092

6709267093
/**
@@ -67099,10 +67100,10 @@ var NonEarthCRS = external_L_default.a.Class.extend({
6709967100
if (!this.resolutions || this.resolutions.length === 0) {
6710067101
var width = Math.max(this.bounds.getSize().x, this.bounds.getSize().y);
6710167102
var defaultScale = 1 / (width / 256);
67102-
return scale / defaultScale;
67103+
return Math.log(scale / defaultScale) / Math.LN2;
6710367104
}
6710467105
for (var i = 0; i < this.resolutions.length; i++) {
67105-
if (1 / this.resolutions == scale) {
67106+
if (1.0 / this.resolutions[i] == scale) {
6710667107
return i
6710767108
}
6710867109
}

dist/leaflet/iclient9-leaflet-es6.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/leaflet/iclient9-leaflet.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23622,10 +23622,10 @@ var NonEarthCRS = exports.NonEarthCRS = _leaflet2["default"].Class.extend({
2362223622
scale: function scale(zoom) {
2362323623
if (!this.resolutions || this.resolutions.length === 0) {
2362423624
var width = Math.max(this.bounds.getSize().x, this.bounds.getSize().y);
23625-
var defaultScale = 1 / (width / 256);
23625+
var defaultScale = 1.0 / (width / 256);
2362623626
return defaultScale * Math.pow(2, zoom);
2362723627
}
23628-
return 1 / this.resolutions[zoom];
23628+
return 1.0 / this.resolutions[zoom];
2362923629
},
2363023630

2363123631
/**
@@ -23638,10 +23638,10 @@ var NonEarthCRS = exports.NonEarthCRS = _leaflet2["default"].Class.extend({
2363823638
if (!this.resolutions || this.resolutions.length === 0) {
2363923639
var width = Math.max(this.bounds.getSize().x, this.bounds.getSize().y);
2364023640
var defaultScale = 1 / (width / 256);
23641-
return scale / defaultScale;
23641+
return Math.log(scale / defaultScale) / Math.LN2;
2364223642
}
2364323643
for (var i = 0; i < this.resolutions.length; i++) {
23644-
if (1 / this.resolutions == scale) {
23644+
if (1.0 / this.resolutions[i] == scale) {
2364523645
return i;
2364623646
}
2364723647
}
@@ -83685,6 +83685,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
8368583685
/**
8368683686
* @class SuperMap.Widgets.ChartView
8368783687
* @classdesc 图表微件
83688+
* @version 9.1.1
8368883689
* @param {string} domID - 图表dom元素ID。
8368983690
* @param {Object} options - 可选参数。
8369083691
* @param {string} options.type - 图表类型。

dist/leaflet/iclient9-leaflet.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/leaflet/core/NonEarthCRS.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ export var NonEarthCRS = L.Class.extend({
7171
scale: function (zoom) {
7272
if (!this.resolutions || this.resolutions.length === 0) {
7373
var width = Math.max(this.bounds.getSize().x, this.bounds.getSize().y);
74-
var defaultScale = 1 / (width / 256);
74+
var defaultScale = 1.0 / (width / 256);
7575
return defaultScale * Math.pow(2, zoom);
7676
}
77-
return 1 / this.resolutions[zoom];
77+
return 1.0 / this.resolutions[zoom];
7878
},
7979

8080
/**
@@ -87,10 +87,10 @@ export var NonEarthCRS = L.Class.extend({
8787
if (!this.resolutions || this.resolutions.length === 0) {
8888
var width = Math.max(this.bounds.getSize().x, this.bounds.getSize().y);
8989
var defaultScale = 1 / (width / 256);
90-
return scale / defaultScale;
90+
return Math.log(scale / defaultScale) / Math.LN2;
9191
}
9292
for (var i = 0; i < this.resolutions.length; i++) {
93-
if (1 / this.resolutions == scale) {
93+
if (1.0 / this.resolutions[i] == scale) {
9494
return i
9595
}
9696
}

test/leaflet/core/NonEarthCRSSpec.js

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -65,26 +65,25 @@ describe('leaflet_NonEarthCRS', () => {
6565
resolutions: [100, 100000]
6666
};
6767
var nonEarthCRS1 = nonEarthCRS(options1);
68-
var bound1 = nonEarthCRS1.zoom(0.1);
69-
expect(bound1).toEqual(-1);
68+
var zoom1 = nonEarthCRS1.zoom(0.1);
69+
expect(zoom1).toEqual(-1);
7070

71-
//此处待开发修改后打开
72-
// var options2 = {
73-
// origin: {x: 30, y: 50},
74-
// bounds: L.bounds([-180, -90], [180, 90]),
75-
// resolutions: [100, 100000]
76-
// };
77-
// var nonEarthCRS2 = nonEarthCRS(options2);
78-
// var bound2 = nonEarthCRS2.zoom(0.01);
79-
// expect(bound2).toEqual(0);
71+
var options2 = {
72+
origin: {x: 30, y: 50},
73+
bounds: L.bounds([-180, -90], [180, 90]),
74+
resolutions: [100, 100000]
75+
};
76+
var nonEarthCRS2 = nonEarthCRS(options2);
77+
var zoom2 = nonEarthCRS2.zoom(0.01);
78+
expect(zoom2).toEqual(0);
8079

8180
var options3 = {
8281
origin: {x: 30, y: 50},
8382
bounds: L.bounds([-128, -90], [128, 90]),
8483
};
8584
var nonEarthCRS3 = nonEarthCRS(options3);
86-
var bound3 = nonEarthCRS3.zoom(10);
87-
expect(bound3).toEqual(10);
85+
var zoom3 = nonEarthCRS3.zoom(16);
86+
expect(zoom3).toEqual(4);
8887
});
8988

9089
it('CRS_distance', () => {

0 commit comments

Comments
 (0)