Skip to content

Commit f363a94

Browse files
committed
webmap支持mapview idi的类型判断
1 parent d9837e9 commit f363a94

File tree

10 files changed

+51
-47
lines changed

10 files changed

+51
-47
lines changed

dist/iclient9-leaflet.css

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/iclient9-leaflet.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59726,13 +59726,14 @@ var WebMap = exports.WebMap = _leaflet2["default"].LayerGroup.extend({
5972659726
}
5972759727
return features;
5972859728
},
59729+
5972959730
parseFeatureFromJson: function parseFeatureFromJson(feature) {
5973059731
var format = new _iclientCommon.GeoJSON();
5973159732
var features = format.read(feature);
5973259733
//兼容insights数据格式
5973359734
if (features == null) {
5973459735
var content = JSON.parse(feature.replace(/'/, '"'));
59735-
if (content.isAnalyseResult) {
59736+
if (content.isAnalyseResult || content.type === 'MapEditor' || content.type === 'DataInsights' || content.type === 'ISERVER') {
5973659737
content = content.data.recordsets[0].features;
5973759738
}
5973859739
format = new _iclientCommon.GeoJSON();
@@ -93990,7 +93991,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
9399093991
/* 500 */
9399193992
/***/ (function(module, exports) {
9399293993

93993-
module.exports = {"_from":"proj4@2.3.15","_id":"proj4@2.3.15","_inBundle":false,"_integrity":"sha1-WtBui8owvg/6OJpJ5FZfUfBtCJ4=","_location":"/proj4","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"proj4@2.3.15","name":"proj4","escapedName":"proj4","rawSpec":"2.3.15","saveSpec":null,"fetchSpec":"2.3.15"},"_requiredBy":["/"],"_resolved":"https://registry.npmjs.org/proj4/-/proj4-2.3.15.tgz","_shasum":"5ad06e8bca30be0ffa389a49e4565f51f06d089e","_spec":"proj4@2.3.15","_where":"F:\\dev\\iClient","author":"","bugs":{"url":"https://github.com/proj4js/proj4js/issues"},"bundleDependencies":false,"contributors":[{"name":"Mike Adair","email":"madair@dmsolutions.ca"},{"name":"Richard Greenwood","email":"rich@greenwoodmap.com"},{"name":"Calvin Metcalf","email":"calvin.metcalf@gmail.com"},{"name":"Richard Marsden","url":"http://www.winwaed.com"},{"name":"T. Mittan"},{"name":"D. Steinwand"},{"name":"S. Nelson"}],"dependencies":{"mgrs":"~0.0.2"},"deprecated":false,"description":"Proj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations.","devDependencies":{"browserify":"~12.0.1","chai":"~1.8.1","curl":"git://github.com/cujojs/curl.git","grunt":"~0.4.2","grunt-browserify":"~4.0.1","grunt-cli":"~0.1.13","grunt-contrib-connect":"~0.6.0","grunt-contrib-jshint":"~0.8.0","grunt-contrib-uglify":"~0.11.1","grunt-mocha-phantomjs":"~0.4.0","istanbul":"~0.2.4","mocha":"~1.17.1","tin":"~0.4.0"},"directories":{"test":"test","doc":"docs"},"homepage":"https://github.com/proj4js/proj4js#readme","jam":{"main":"dist/proj4.js","include":["dist/proj4.js","README.md","AUTHORS","LICENSE.md"]},"license":"MIT","main":"lib/index.js","name":"proj4","repository":{"type":"git","url":"git://github.com/proj4js/proj4js.git"},"scripts":{"test":"./node_modules/istanbul/lib/cli.js test ./node_modules/mocha/bin/_mocha test/test.js"},"version":"2.3.15"}
93994+
module.exports = {"_args":[["proj4@2.3.15","E:\\git\\iClient9"]],"_from":"proj4@2.3.15","_id":"proj4@2.3.15","_inBundle":false,"_integrity":"sha1-WtBui8owvg/6OJpJ5FZfUfBtCJ4=","_location":"/proj4","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"proj4@2.3.15","name":"proj4","escapedName":"proj4","rawSpec":"2.3.15","saveSpec":null,"fetchSpec":"2.3.15"},"_requiredBy":["/"],"_resolved":"http://registry.npm.taobao.org/proj4/download/proj4-2.3.15.tgz","_spec":"2.3.15","_where":"E:\\git\\iClient9","author":"","bugs":{"url":"https://github.com/proj4js/proj4js/issues"},"contributors":[{"name":"Mike Adair","email":"madair@dmsolutions.ca"},{"name":"Richard Greenwood","email":"rich@greenwoodmap.com"},{"name":"Calvin Metcalf","email":"calvin.metcalf@gmail.com"},{"name":"Richard Marsden","url":"http://www.winwaed.com"},{"name":"T. Mittan"},{"name":"D. Steinwand"},{"name":"S. Nelson"}],"dependencies":{"mgrs":"~0.0.2"},"description":"Proj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations.","devDependencies":{"browserify":"~12.0.1","chai":"~1.8.1","curl":"git://github.com/cujojs/curl.git","grunt":"~0.4.2","grunt-browserify":"~4.0.1","grunt-cli":"~0.1.13","grunt-contrib-connect":"~0.6.0","grunt-contrib-jshint":"~0.8.0","grunt-contrib-uglify":"~0.11.1","grunt-mocha-phantomjs":"~0.4.0","istanbul":"~0.2.4","mocha":"~1.17.1","tin":"~0.4.0"},"directories":{"test":"test","doc":"docs"},"homepage":"https://github.com/proj4js/proj4js#readme","jam":{"main":"dist/proj4.js","include":["dist/proj4.js","README.md","AUTHORS","LICENSE.md"]},"license":"MIT","main":"lib/index.js","name":"proj4","repository":{"type":"git","url":"git://github.com/proj4js/proj4js.git"},"scripts":{"test":"./node_modules/istanbul/lib/cli.js test ./node_modules/mocha/bin/_mocha test/test.js"},"version":"2.3.15"}
9399493995

9399593996
/***/ }),
9399693997
/* 501 */

dist/iclient9-leaflet.min.css

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/iclient9-leaflet.min.js

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

dist/iclient9-openlayers.css

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/iclient9-openlayers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59141,7 +59141,7 @@ var WebMap = exports.WebMap = function (_ol$Observable) {
5914159141
//兼容insights数据格式
5914259142
if (features == null) {
5914359143
var content = JSON.parse(feature.replace(/'/, '"'));
59144-
if (content.isAnalyseResult) {
59144+
if (content.isAnalyseResult || content.type === 'MapEditor' || content.type === 'DataInsights' || content.type === 'ISERVER') {
5914559145
content = content.data.recordsets[0].features;
5914659146
}
5914759147
format = new _iclientCommon.GeoJSON();
@@ -91725,7 +91725,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
9172591725
/* 472 */
9172691726
/***/ (function(module, exports) {
9172791727

91728-
module.exports = {"_from":"proj4@2.3.15","_id":"proj4@2.3.15","_inBundle":false,"_integrity":"sha1-WtBui8owvg/6OJpJ5FZfUfBtCJ4=","_location":"/proj4","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"proj4@2.3.15","name":"proj4","escapedName":"proj4","rawSpec":"2.3.15","saveSpec":null,"fetchSpec":"2.3.15"},"_requiredBy":["/"],"_resolved":"https://registry.npmjs.org/proj4/-/proj4-2.3.15.tgz","_shasum":"5ad06e8bca30be0ffa389a49e4565f51f06d089e","_spec":"proj4@2.3.15","_where":"F:\\dev\\iClient","author":"","bugs":{"url":"https://github.com/proj4js/proj4js/issues"},"bundleDependencies":false,"contributors":[{"name":"Mike Adair","email":"madair@dmsolutions.ca"},{"name":"Richard Greenwood","email":"rich@greenwoodmap.com"},{"name":"Calvin Metcalf","email":"calvin.metcalf@gmail.com"},{"name":"Richard Marsden","url":"http://www.winwaed.com"},{"name":"T. Mittan"},{"name":"D. Steinwand"},{"name":"S. Nelson"}],"dependencies":{"mgrs":"~0.0.2"},"deprecated":false,"description":"Proj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations.","devDependencies":{"browserify":"~12.0.1","chai":"~1.8.1","curl":"git://github.com/cujojs/curl.git","grunt":"~0.4.2","grunt-browserify":"~4.0.1","grunt-cli":"~0.1.13","grunt-contrib-connect":"~0.6.0","grunt-contrib-jshint":"~0.8.0","grunt-contrib-uglify":"~0.11.1","grunt-mocha-phantomjs":"~0.4.0","istanbul":"~0.2.4","mocha":"~1.17.1","tin":"~0.4.0"},"directories":{"test":"test","doc":"docs"},"homepage":"https://github.com/proj4js/proj4js#readme","jam":{"main":"dist/proj4.js","include":["dist/proj4.js","README.md","AUTHORS","LICENSE.md"]},"license":"MIT","main":"lib/index.js","name":"proj4","repository":{"type":"git","url":"git://github.com/proj4js/proj4js.git"},"scripts":{"test":"./node_modules/istanbul/lib/cli.js test ./node_modules/mocha/bin/_mocha test/test.js"},"version":"2.3.15"}
91728+
module.exports = {"_args":[["proj4@2.3.15","E:\\git\\iClient9"]],"_from":"proj4@2.3.15","_id":"proj4@2.3.15","_inBundle":false,"_integrity":"sha1-WtBui8owvg/6OJpJ5FZfUfBtCJ4=","_location":"/proj4","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"proj4@2.3.15","name":"proj4","escapedName":"proj4","rawSpec":"2.3.15","saveSpec":null,"fetchSpec":"2.3.15"},"_requiredBy":["/"],"_resolved":"http://registry.npm.taobao.org/proj4/download/proj4-2.3.15.tgz","_spec":"2.3.15","_where":"E:\\git\\iClient9","author":"","bugs":{"url":"https://github.com/proj4js/proj4js/issues"},"contributors":[{"name":"Mike Adair","email":"madair@dmsolutions.ca"},{"name":"Richard Greenwood","email":"rich@greenwoodmap.com"},{"name":"Calvin Metcalf","email":"calvin.metcalf@gmail.com"},{"name":"Richard Marsden","url":"http://www.winwaed.com"},{"name":"T. Mittan"},{"name":"D. Steinwand"},{"name":"S. Nelson"}],"dependencies":{"mgrs":"~0.0.2"},"description":"Proj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations.","devDependencies":{"browserify":"~12.0.1","chai":"~1.8.1","curl":"git://github.com/cujojs/curl.git","grunt":"~0.4.2","grunt-browserify":"~4.0.1","grunt-cli":"~0.1.13","grunt-contrib-connect":"~0.6.0","grunt-contrib-jshint":"~0.8.0","grunt-contrib-uglify":"~0.11.1","grunt-mocha-phantomjs":"~0.4.0","istanbul":"~0.2.4","mocha":"~1.17.1","tin":"~0.4.0"},"directories":{"test":"test","doc":"docs"},"homepage":"https://github.com/proj4js/proj4js#readme","jam":{"main":"dist/proj4.js","include":["dist/proj4.js","README.md","AUTHORS","LICENSE.md"]},"license":"MIT","main":"lib/index.js","name":"proj4","repository":{"type":"git","url":"git://github.com/proj4js/proj4js.git"},"scripts":{"test":"./node_modules/istanbul/lib/cli.js test ./node_modules/mocha/bin/_mocha test/test.js"},"version":"2.3.15"}
9172991729

9173091730
/***/ }),
9173191731
/* 473 */

dist/iclient9-openlayers.min.css

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/iclient9-openlayers.min.js

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

src/leaflet/mapping/WebMap.js

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,20 @@ import {
1313
CommonUtil as Util,
1414
GetFeaturesBySQLParameters
1515
} from '@supermap/iclient-common';
16-
import {CartoCSSToLeaflet} from '../overlay/carto/CartoCSSToLeaflet' ;
17-
import {NonEarthCRS} from "../core/NonEarthCRS";
18-
import {Graphic} from '../overlay/graphic/Graphic';
19-
import {baiduTileLayer} from './BaiduTileLayer';
20-
import {wmtsLayer} from './TileLayer.WMTS';
21-
import {cloudTileLayer} from './CloudTileLayer';
22-
import {tiledMapLayer} from './TiledMapLayer';
23-
import {UniqueThemeLayer} from "../overlay/UniqueThemeLayer";
24-
import {RangeThemeLayer} from "../overlay/RangeThemeLayer";
25-
import {LabelThemeLayer} from "../overlay/LabelThemeLayer";
26-
import {featureService} from "../services/FeatureService";
27-
import {ThemeFeature} from '../overlay/theme/ThemeFeature';
28-
import {UnicodeMarker} from '../overlay/UnicodeMarker';
29-
import {TiandituTileLayer} from '../mapping/TiandituTileLayer';
16+
import { CartoCSSToLeaflet } from '../overlay/carto/CartoCSSToLeaflet';
17+
import { NonEarthCRS } from "../core/NonEarthCRS";
18+
import { Graphic } from '../overlay/graphic/Graphic';
19+
import { baiduTileLayer } from './BaiduTileLayer';
20+
import { wmtsLayer } from './TileLayer.WMTS';
21+
import { cloudTileLayer } from './CloudTileLayer';
22+
import { tiledMapLayer } from './TiledMapLayer';
23+
import { UniqueThemeLayer } from "../overlay/UniqueThemeLayer";
24+
import { RangeThemeLayer } from "../overlay/RangeThemeLayer";
25+
import { LabelThemeLayer } from "../overlay/LabelThemeLayer";
26+
import { featureService } from "../services/FeatureService";
27+
import { ThemeFeature } from '../overlay/theme/ThemeFeature';
28+
import { UnicodeMarker } from '../overlay/UnicodeMarker';
29+
import { TiandituTileLayer } from '../mapping/TiandituTileLayer';
3030
import "@supermap/iclient-common/style/supermapol-icons.css";
3131

3232
/**
@@ -158,7 +158,7 @@ export var WebMap = L.LayerGroup.extend({
158158
}
159159
this.createLayer(type, layerInfo);
160160
}
161-
this.fire('mapLoaded', {map: this._map});
161+
this.fire('mapLoaded', { map: this._map });
162162
},
163163

164164
/**
@@ -217,9 +217,9 @@ export var WebMap = L.LayerGroup.extend({
217217
renderer: L.canvas()
218218
});
219219
if (crs instanceof NonEarthCRS) {
220-
this._map.setZoom(options.zoom ? options.zoom + 2 : 2, {maxZoom: options.maxZoom || 22});
220+
this._map.setZoom(options.zoom ? options.zoom + 2 : 2, { maxZoom: options.maxZoom || 22 });
221221
} else {
222-
this._map.fitBounds(bounds, {maxZoom: options.maxZoom || 22});
222+
this._map.fitBounds(bounds, { maxZoom: options.maxZoom || 22 });
223223
}
224224
},
225225

@@ -270,7 +270,7 @@ export var WebMap = L.LayerGroup.extend({
270270
};
271271
var layer;
272272
switch (type) {
273-
case "SUPERMAP_REST" :
273+
case "SUPERMAP_REST":
274274
layer = tiledMapLayer(layerInfo.url, {
275275
transparent: true,
276276
opacity: opacity
@@ -314,7 +314,7 @@ export var WebMap = L.LayerGroup.extend({
314314
mapOptions.crs = L.CRS.EPSG3857;
315315
mapOptions.zoom = 3 + mapOptions.zoom;
316316
mapOptions.minZoom = 3;
317-
layer = cloudTileLayer(layerInfo.url, {opacity: opacity});
317+
layer = cloudTileLayer(layerInfo.url, { opacity: opacity });
318318
break;
319319
case "MARKER_LAYER":
320320
layer = this.createMarkersLayer(layerInfo, crs);
@@ -564,7 +564,7 @@ export var WebMap = L.LayerGroup.extend({
564564
return new UnicodeMarker(latlng, featureStyle)
565565
}
566566
}
567-
return L.geoJSON({type: "GeometryCollection", geometries: []}, {
567+
return L.geoJSON({ type: "GeometryCollection", geometries: [] }, {
568568
pointToLayer: pointToLayer,
569569
coordsToLatLng: coordsToLatLng,
570570
opacity: opacity
@@ -717,15 +717,15 @@ export var WebMap = L.LayerGroup.extend({
717717
if (data.type === 'EXCEL' || data.type === 'CSV') {
718718
features = me.parseFeatureFromEXCEL.apply(me, [data.content.rows, data.content.colTitles, false, position]);
719719
for (var x = 0, len = features.length; x < len; x++) {
720-
result = jsonsql({attr: features[x].attributes}, sql);
720+
result = jsonsql({ attr: features[x].attributes }, sql);
721721
if (result.length > 0) {
722722
sFeaturesArr.push(features[x])
723723
}
724724
}
725725
} else {
726726
features = me.parseFeatureFromJson(data.content);
727727
for (var i = 0, length = features.length; i < length; i++) {
728-
result = jsonsql({attr: features[i].attributes}, sql);
728+
result = jsonsql({ attr: features[i].attributes }, sql);
729729
if (result.length > 0) {
730730
sFeaturesArr.push(features[i]);
731731
}
@@ -746,7 +746,7 @@ export var WebMap = L.LayerGroup.extend({
746746
var newFeautures = [], features = layerInfo.features;
747747
for (var i = 0, len = features.length; i < len; i++) {
748748
var feature = features[i];
749-
var sqlResult = jsonsql({attr: feature.attributes}, sql);
749+
var sqlResult = jsonsql({ attr: feature.attributes }, sql);
750750
if (sqlResult.length > 0) {
751751
var lon = feature.geometry.points[0].x,
752752
lat = feature.geometry.points[0].y;
@@ -957,11 +957,11 @@ export var WebMap = L.LayerGroup.extend({
957957
if (point && point.length !== undefined) {
958958
newCoord = [];
959959
for (var i = 0, len = point.length; i < len; i++) {
960-
var coor = {x: point[i].x, y: point[i].y};
960+
var coor = { x: point[i].x, y: point[i].y };
961961
newCoord.push(coor);
962962
}
963963
} else {
964-
newCoord = {x: point.x, y: point.y};
964+
newCoord = { x: point.x, y: point.y };
965965
}
966966
if (success) {
967967
success.call(this, newCoord);
@@ -985,14 +985,14 @@ export var WebMap = L.LayerGroup.extend({
985985
newCoor = [];
986986
for (var i = 0, len = point.length; i < len; i++) {
987987
var coor = proj4(fromEpsg, toEpsg, [point[i].x, point[i].y]);
988-
newCoor.push({x: coor[0], y: coor[1]});
988+
newCoor.push({ x: coor[0], y: coor[1] });
989989
}
990990
} else {
991991
newCoor = proj4(fromEpsg, toEpsg, [point.x, point.y]);
992-
newCoor = {x: newCoor[0], y: newCoor[1]};
992+
newCoor = { x: newCoor[0], y: newCoor[1] };
993993
}
994994
if (success) {
995-
me.fire('coordconvertsuccess', {newCoor: newCoor});
995+
me.fire('coordconvertsuccess', { newCoor: newCoor });
996996
success.call(me, newCoor);
997997
}
998998
},
@@ -1003,10 +1003,10 @@ export var WebMap = L.LayerGroup.extend({
10031003
}
10041004
if (point && point.length !== undefined) {
10051005
for (var i = 0, len = point.length; i < len; i++) {
1006-
epsgArray.push({x: point[i].x, y: point[i].y});
1006+
epsgArray.push({ x: point[i].x, y: point[i].y });
10071007
}
10081008
} else {
1009-
epsgArray = [{x: point.x, y: point.y}];
1009+
epsgArray = [{ x: point.x, y: point.y }];
10101010
}
10111011
if (epsgArray.length === 0) {
10121012
return success.call(me, null);
@@ -1029,7 +1029,7 @@ export var WebMap = L.LayerGroup.extend({
10291029
if (!point && point.length !== undefined) {
10301030
newCoors = newCoors[0];
10311031
}
1032-
me.fire('coordconvertsuccess', {newCoors: newCoors});
1032+
me.fire('coordconvertsuccess', { newCoors: newCoors });
10331033
success.call(me, newCoors);
10341034
}
10351035
}
@@ -1038,7 +1038,7 @@ export var WebMap = L.LayerGroup.extend({
10381038
if (!me.actived) {
10391039
return;
10401040
}
1041-
me.fire('coordconvertfailed', {err: err});
1041+
me.fire('coordconvertfailed', { err: err });
10421042
},
10431043
scope: this
10441044
};
@@ -1094,13 +1094,14 @@ export var WebMap = L.LayerGroup.extend({
10941094

10951095

10961096
},
1097+
10971098
parseFeatureFromJson: function (feature) {
10981099
var format = new GeoJSONFormat();
10991100
var features = format.read(feature);
11001101
//兼容insights数据格式
11011102
if (features == null) {
11021103
var content = JSON.parse(feature.replace(/'/, '"'));
1103-
if (content.isAnalyseResult) {
1104+
if (content.isAnalyseResult || content.type === 'MapEditor' || content.type === 'DataInsights' || content.type === 'ISERVER') {
11041105
content = content.data.recordsets[0].features;
11051106
}
11061107
format = new GeoJSONFormat();
@@ -1146,7 +1147,7 @@ export var WebMap = L.LayerGroup.extend({
11461147
return;
11471148
}
11481149
if (this.selectedFeature) {
1149-
this.fire('featureUnSelected', {feature: this.selectedFeature});
1150+
this.fire('featureUnSelected', { feature: this.selectedFeature });
11501151
this.selectedFeature = null;
11511152
}
11521153
let feature;
@@ -1155,7 +1156,7 @@ export var WebMap = L.LayerGroup.extend({
11551156
}
11561157
if (feature) {
11571158
this.selectedFeature = feature;
1158-
this.fire('featureSelected', {feature: feature});
1159+
this.fire('featureSelected', { feature: feature });
11591160
}
11601161
});
11611162
themeLayer.on('mousemove', evt => {
@@ -1168,7 +1169,7 @@ export var WebMap = L.LayerGroup.extend({
11681169
feature = themeLayer.getFeatureById(evt.target.refDataID);
11691170
}
11701171
if (feature) {
1171-
this.fire('featureMousemove', {feature: feature});
1172+
this.fire('featureMousemove', { feature: feature });
11721173
}
11731174

11741175
}

src/openlayers/mapping/WebMap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1082,7 +1082,7 @@ export class WebMap extends ol.Observable {
10821082
//兼容insights数据格式
10831083
if (features == null) {
10841084
var content = JSON.parse(feature.replace(/'/, '"'));
1085-
if (content.isAnalyseResult) {
1085+
if (content.isAnalyseResult || content.type === 'MapEditor' || content.type === 'DataInsights' || content.type === 'ISERVER') {
10861086
content = content.data.recordsets[0].features;
10871087
}
10881088
format = new GeoJSONFormat();

0 commit comments

Comments
 (0)