Skip to content

Commit ca12a52

Browse files
committed
优化例子
1 parent af14686 commit ca12a52

File tree

7 files changed

+21
-14
lines changed

7 files changed

+21
-14
lines changed

dist/mapboxgl/iclient9-mapboxgl-es6.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67345,12 +67345,11 @@ class services_DataFlowService_DataFlowService extends ServiceBase_ServiceBase {
6734567345

6734667346

6734767347
constructor(url, options) {
67348-
super(url, options);
6734967348
options = options || {};
6735067349
if (options.projection) {
67351-
this.options.prjCoordSys = options.projection;
67350+
options.prjCoordSys = options.projection;
6735267351
}
67353-
ServiceBase_ServiceBase.call(this, url, options);
67352+
super(url, options);
6735467353
this.dataFlow = new DataFlowService_DataFlowService(url, options);
6735567354
this.dataFlow.events.on({
6735667355
"broadcastSocketConnected": this._defaultEvent,

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55703,13 +55703,13 @@ var DataFlowService = exports.DataFlowService = function (_ServiceBase) {
5570355703
function DataFlowService(url, options) {
5570455704
_classCallCheck(this, DataFlowService);
5570555705

55706-
var _this = _possibleConstructorReturn(this, (DataFlowService.__proto__ || Object.getPrototypeOf(DataFlowService)).call(this, url, options));
55707-
5570855706
options = options || {};
5570955707
if (options.projection) {
55710-
_this.options.prjCoordSys = options.projection;
55708+
options.prjCoordSys = options.projection;
5571155709
}
55712-
_ServiceBase2.ServiceBase.call(_this, url, options);
55710+
55711+
var _this = _possibleConstructorReturn(this, (DataFlowService.__proto__ || Object.getPrototypeOf(DataFlowService)).call(this, url, options));
55712+
5571355713
_this.dataFlow = new _iclientCommon.DataFlowService(url, options);
5571455714
_this.dataFlow.events.on({
5571555715
"broadcastSocketConnected": _this._defaultEvent,

dist/mapboxgl/iclient9-mapboxgl.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.

examples/js/include-web.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@
136136
}
137137
if (inArray(includes, 'sticklr')) {
138138
inputCSS("http://iclient.supermap.io/libs/iclient8c/examples/css/jquery-sticklr.css");
139+
inputCSS("http://iclient.supermap.io/libs/iclient8c/examples/css/icon.css");
139140
}
140141
if (inArray(includes, 'responsive')) {
141142
inputCSS("http://iclient.supermap.io/libs/iclient8c/examples/css/bootstrap-responsive.min.css");

examples/openlayers/mvtVectorLayer4326.html

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
<meta charset="UTF-8">
55
<title data-i18n="resources.title_mvtVectorLayer4326"></title>
66
<script type="text/javascript" src="../js/include-web.js"></script>
7-
<script type="text/javascript" src="../../dist/openlayers/include-openlayers.js"></script>
7+
<!--<script type="text/javascript" src="../../dist/include-openlayers.js"></script>-->
8+
<link href="https://cdn.bootcss.com/openlayers/4.6.5/ol-debug.css" rel="stylesheet">
9+
<!--当前示例使用 ol-debug 原因:ol.format.MVT 默认坐标系为 3857,最新代码未更新该默认设置,需使用ol-debug,设置 defaultDataProjection 参数,以支持4326底图-->
10+
<script src="https://cdn.bootcss.com/openlayers/4.6.5/ol-debug.js"></script>
11+
<script type="text/javascript" src="../../dist/openlayers/iclient9-openlayers.min.js"></script>
812
</head>
913
<body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%">
1014
<div id="map" style="margin:0 auto;width: 100%;height: 100%;border: 1px solid #dddddd"></div>
@@ -27,7 +31,11 @@
2731
}
2832
var vectorTileStyles = new ol.supermap.VectorTileStyles(stylesOptions);
2933
var vectorTileOptions = ol.source.VectorTileSuperMapRest.optionsFromMapJSON(url, serviceResult.result);
30-
vectorTileOptions.format = new ol.format.MVT();
34+
vectorTileOptions.format = new ol.format.MVT({featureClass: ol.Feature});
35+
vectorTileOptions.format.defaultDataProjection = new ol.proj.Projection({
36+
code: 'EPSG:4326',
37+
units: ol.proj.Units.TILE_PIXELS
38+
});
3139
var vectorLayer = new ol.layer.VectorTile({
3240
//设置避让参数
3341
declutter: true,

src/mapboxgl/services/DataFlowService.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,11 @@ export class DataFlowService extends ServiceBase {
2424

2525

2626
constructor(url, options) {
27-
super(url, options);
2827
options = options || {};
2928
if (options.projection) {
30-
this.options.prjCoordSys = options.projection;
29+
options.prjCoordSys = options.projection;
3130
}
32-
ServiceBase.call(this, url, options);
31+
super(url, options);
3332
this.dataFlow = new DataFlow(url, options);
3433
this.dataFlow.events.on({
3534
"broadcastSocketConnected": this._defaultEvent,

0 commit comments

Comments
 (0)