egovamap 0.33.30 → 0.33.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -134,136 +134,124 @@ var EGovaGISMap = function (
134
134
  that.onMapLoaded = function () {
135
135
  that.isLoading = false;
136
136
  that.gisLoaded = true;
137
- var cb = function() {
138
- if (context.mapCenterFlag) {
139
- if (context.mapCenterFlag == "1") {
140
- if (context.coordinateX && context.coordinateY) {
141
- that.centerAndZoom(
142
- context.coordinateX,
143
- context.coordinateY,
144
- 4
145
- );
146
- }
147
- } else if (context.mapCenterFlag == "2") {
148
- if (context.coordinateX && context.coordinateY) {
149
- that.centerAndZoom(
150
- context.coordinateX,
151
- context.coordinateY,
152
- 1
153
- );
154
- }
155
- if (context.humanLayerUsageID && context.regionCode) {
156
- var zoom = gisParams && gisParams.maskZoom == true;
157
- var style = {
158
- type: "simple-fill",
137
+ if (context.mapCenterFlag) {
138
+ if (context.mapCenterFlag == "1") {
139
+ if (context.coordinateX && context.coordinateY) {
140
+ that.centerAndZoom(
141
+ context.coordinateX,
142
+ context.coordinateY,
143
+ 4
144
+ );
145
+ }
146
+ } else if (context.mapCenterFlag == "2") {
147
+ if (context.coordinateX && context.coordinateY) {
148
+ that.centerAndZoom(
149
+ context.coordinateX,
150
+ context.coordinateY,
151
+ 1
152
+ );
153
+ }
154
+ if (context.humanLayerUsageID && context.regionCode) {
155
+ var zoom = gisParams && gisParams.maskZoom == true;
156
+ var style = {
157
+ type: "simple-fill",
158
+ style: "solid",
159
+ color: [100, 100, 255, 0.5],
160
+ outline: {
161
+ type: "simple-line",
159
162
  style: "solid",
160
- color: [100, 100, 255, 0.5],
161
- outline: {
162
- type: "simple-line",
163
- style: "solid",
164
- color: [255, 0, 0, 1],
165
- width: 1,
166
- },
167
- };
168
- var pos = {
169
- visible: true,
170
- top: 95,
171
- right: 127,
172
- };
173
- if (mapConfig && mapConfig.maskPos) {
174
- pos = MapUtils.deepClones(
175
- true,
176
- {},
177
- pos,
178
- mapConfig.maskPos
179
- );
180
- }
181
- that.addMaskLayer(
182
- context.humanLayerUsageID,
183
- context.humanLayerKeyFieldName,
184
- context.regionCode,
185
- style,
186
- zoom,
187
- pos
163
+ color: [255, 0, 0, 1],
164
+ width: 1,
165
+ },
166
+ };
167
+ var pos = {
168
+ visible: true,
169
+ top: 95,
170
+ right: 127,
171
+ };
172
+ if (mapConfig && mapConfig.maskPos) {
173
+ pos = MapUtils.deepClones(
174
+ true,
175
+ {},
176
+ pos,
177
+ mapConfig.maskPos
188
178
  );
189
179
  }
190
- } else if (context.mapCenterFlag == "3") {
191
- if (context.coordinateX && context.coordinateY) {
192
- that.centerAndZoom(
193
- context.coordinateX,
194
- context.coordinateY,
195
- 1
196
- );
197
- }
198
- if (context.humanLayerUsageID && context.regionCode) {
199
- var zoom = gisParams && gisParams.maskZoom == false;
200
- var style = {
201
- type: "simple-fill",
180
+ that.addMaskLayer(
181
+ context.humanLayerUsageID,
182
+ context.humanLayerKeyFieldName,
183
+ context.regionCode,
184
+ style,
185
+ zoom,
186
+ pos
187
+ );
188
+ }
189
+ } else if (context.mapCenterFlag == "3") {
190
+ if (context.coordinateX && context.coordinateY) {
191
+ that.centerAndZoom(
192
+ context.coordinateX,
193
+ context.coordinateY,
194
+ 1
195
+ );
196
+ }
197
+ if (context.humanLayerUsageID && context.regionCode) {
198
+ var zoom = gisParams && gisParams.maskZoom == false;
199
+ var style = {
200
+ type: "simple-fill",
201
+ style: "solid",
202
+ color: [100, 100, 255, 0],
203
+ outline: {
204
+ type: "simple-line",
202
205
  style: "solid",
203
- color: [100, 100, 255, 0],
204
- outline: {
205
- type: "simple-line",
206
- style: "solid",
207
- color: [255, 0, 0, 1],
208
- width: 3,
209
- },
210
- };
211
- var pos = {
212
- visible: true,
213
- top: 95,
214
- right: 127,
215
- };
216
- if (mapConfig && mapConfig.maskPos) {
217
- pos = MapUtils.deepClones(
218
- true,
219
- {},
220
- pos,
221
- mapConfig.maskPos
222
- );
223
- }
224
- that.addMaskLayer(
225
- context.humanLayerUsageID,
226
- context.humanLayerKeyFieldName,
227
- context.regionCode,
228
- style,
229
- zoom,
230
- pos
206
+ color: [255, 0, 0, 1],
207
+ width: 3,
208
+ },
209
+ };
210
+ var pos = {
211
+ visible: true,
212
+ top: 95,
213
+ right: 127,
214
+ };
215
+ if (mapConfig && mapConfig.maskPos) {
216
+ pos = MapUtils.deepClones(
217
+ true,
218
+ {},
219
+ pos,
220
+ mapConfig.maskPos
231
221
  );
232
222
  }
223
+ that.addMaskLayer(
224
+ context.humanLayerUsageID,
225
+ context.humanLayerKeyFieldName,
226
+ context.regionCode,
227
+ style,
228
+ zoom,
229
+ pos
230
+ );
233
231
  }
234
232
  }
235
- try {
236
- //如果启用了实景功能需要注册实景监听
237
- if (context.mmsEnabled != undefined && that.gisMapContainer) {
238
- var mmsEnabled = Number(context.mmsEnabled);
239
- if (mmsEnabled > 0) {
240
- var eMap = window.eMapList[that.id];
241
- mmsMap = new EGovaMMSMap(
242
- $container,
243
- scene,
244
- msgPrefix,
245
- context.mmsParams,
246
- mapConfig,
247
- mmsEnabled,
248
- eMap
249
- );
250
- }
233
+ }
234
+ try {
235
+ //如果启用了实景功能需要注册实景监听
236
+ if (context.mmsEnabled != undefined && that.gisMapContainer) {
237
+ var mmsEnabled = Number(context.mmsEnabled);
238
+ if (mmsEnabled > 0) {
239
+ var eMap = window.eMapList[that.id];
240
+ mmsMap = new EGovaMMSMap(
241
+ $container,
242
+ scene,
243
+ msgPrefix,
244
+ context.mmsParams,
245
+ mapConfig,
246
+ mmsEnabled,
247
+ eMap
248
+ );
251
249
  }
252
- } catch (e) {
253
- console.error(e.message);
254
250
  }
255
- callback && callback();
256
- };
257
- var eMap = window.eMapList[that.id];
258
- if (context.gisServerType === 'emapview') {
259
- $.get(eMap.serverURL + '/home/gis/map/getsysconfig.htm?getConfigMode=onlyGetOtherConfig', {}, function (data) {
260
- eMap.egovagis.sysConfig = $.extend({}, eMap.egovagis.sysConfig, data[0]);
261
- cb(),
262
- 'jsonp';
263
- })
264
- } else {
265
- cb();
251
+ } catch (e) {
252
+ console.error(e.message);
266
253
  }
254
+ callback && callback();
267
255
  };
268
256
 
269
257
  that.init = function () {
@@ -2119,8 +2119,10 @@ var EGovaGlobeMap = function (
2119
2119
  /*地图上标注返回坐标值*/
2120
2120
  that.pointSelect = function (symbolType, mapZoom2Point, clickCallback) {
2121
2121
  if (scene == null) return;
2122
- that.removeEventBind('pointSelectCallback');
2123
- if (clickCallback != undefined) {
2122
+ if (!(clickCallback && clickCallback.keep)) {
2123
+ that.removeEventBind('pointSelectCallback');
2124
+ }
2125
+ if (typeof clickCallback === 'function') {
2124
2126
  that.bindEvent('pointSelectCallback', function (position) {
2125
2127
  that.removeEventBind('pointSelectCallback');
2126
2128
  var resultPosition = [
@@ -2131,10 +2133,16 @@ var EGovaGlobeMap = function (
2131
2133
  resultPosition.push(position.args[0]);
2132
2134
  clickCallback(resultPosition);
2133
2135
  });
2136
+ } else if (clickCallback && typeof clickCallback.clickCallback === 'function') {
2137
+ that.bindEvent('pointSelectCallback', function (position) {
2138
+ if (!clickCallback.keep) {
2139
+ that.removeEventBind('pointSelectCallback');
2140
+ }
2141
+ });
2134
2142
  }
2135
2143
  scene.fire(
2136
2144
  msgPrefix + ':pointSelect',
2137
- { args: [symbolType, mapZoom2Point] },
2145
+ { args: [symbolType, mapZoom2Point, clickCallback] },
2138
2146
  parentScene,
2139
2147
  false
2140
2148
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "egovamap",
3
- "version": "0.33.30",
3
+ "version": "0.33.32",
4
4
  "description": "eUrbanGIS SDK",
5
5
  "main": "index.js",
6
6
  "scripts": {