MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / constructor

Method constructor

src/openlayers/mapping/WebMap.js:118–153  ·  view source on GitHub ↗
(id, options)

Source from the content-addressed store, hash-verified

116 */
117export class WebMap extends Observable {
118 constructor(id, options) {
119 super();
120 if (Util.isObject(id)) {
121 options = id;
122 this.mapId = options.id;
123 } else {
124 this.mapId = id;
125 }
126 options = options || {};
127 this.server = options.server;
128 this.successCallback = options.successCallback;
129 this.errorCallback = options.errorCallback;
130 this.credentialKey = options.credentialKey;
131 this.credentialValue = options.credentialValue;
132 this.target = options.target || 'map';
133 this.serviceProxy = options.serviceProxy || null;
134 this.tiandituKey = options.tiandituKey;
135 this.bingMapsKey = options.bingMapsKey || '';
136 this.googleMapsAPIKey = options.googleMapsAPIKey || '';
137 this.proxy = options.proxy;
138 //计数叠加图层,处理过的数量(成功和失败都会计数)
139 this.layerAdded = 0;
140 this.layers = [];
141 this.events = new Events(this, null, ['updateDataflowFeature'], true);
142 this.webMap = options.webMap;
143 this.tileFormat = options.tileFormat && options.tileFormat.toLowerCase();
144 this.restDataSingleRequestCount = options.restDataSingleRequestCount || 1000;
145 this.tileRequestParameters = options.tileRequestParameters;
146 this.createMap(options.mapSetting);
147 if (this.webMap) {
148 // webmap有可能是url地址,有可能是webmap对象
149 Util.isString(this.webMap) ? this.createWebmap(this.webMap) : this.getMapInfoSuccess(options.webMap);
150 } else {
151 this.createWebmap();
152 }
153 }
154
155 /**
156 * @private

Callers

nothing calls this directly

Calls 3

createMapMethod · 0.95
createWebmapMethod · 0.95
getMapInfoSuccessMethod · 0.95

Tested by

no test coverage detected