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

Method source

test/tool/mock_l7.js:138–185  ·  view source on GitHub ↗
(data, options = {})

Source from the content-addressed store, hash-verified

136 };
137 }
138 source(data, options = {}) {
139 const parser = options.parser || { type: 'geojson' };
140 let dataArray = [];
141 if (parser.type === 'geojson') {
142 dataArray = data;
143 }
144 if (parser.type === 'json') {
145 dataArray = [
146 {
147 航班有效期结束: 2016.11,
148 到达城市: '北京',
149 smpid: 1,
150 coordinates: [
151 [80.30091874, 41.26940127],
152 [116.395645, 39.92998578]
153 ]
154 }
155 ];
156 }
157 this.layerSource = {
158 ...options,
159 parser,
160 originData: data.features ? data : { type: 'FeatureCollection', features: data },
161 data: {
162 dataArray: parser.type === 'geojson' ? data : []
163 }
164 };
165 if (parser.type === 'mvt') {
166 this.layerSource.tileset = {
167 cacheTiles: this.rawConfig.name.includes('empty')
168 ? new Map()
169 : new Map([
170 [
171 '0',
172 {
173 data: {
174 vectorLayerCache: {
175 [options.sourceLayer]: [{ properties: {} }]
176 }
177 }
178 }
179 ]
180 ]),
181 isLoaded: false
182 };
183 }
184 return this;
185 }
186 style() {
187 return this;
188 }

Callers 3

L7LayerSpec.jsFile · 0.80
L7LayerSpec.jsFile · 0.80
getL7LayerFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected