MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / createCanvasContext2D

Function createCanvasContext2D

src/openlayers/core/Util.js:279–288  ·  view source on GitHub ↗

* @function Util.createCanvasContext2D * @description 创建 2D 画布。 * @param {number} opt_width - 画布宽度。 * @param {number} opt_height - 画布高度。 * @private

(opt_width, opt_height)

Source from the content-addressed store, hash-verified

277 * @private
278 */
279 createCanvasContext2D(opt_width, opt_height) {
280 const canvas = document.createElement('CANVAS');
281 if (opt_width) {
282 canvas.width = opt_width;
283 }
284 if (opt_height) {
285 canvas.height = opt_height;
286 }
287 return canvas.getContext('2d');
288 },
289 /**
290 * @function Util.supportWebGL2
291 * @description 是否支持 webgl2。

Callers

nothing calls this directly

Calls 2

createElementMethod · 0.80
getContextMethod · 0.45

Tested by

no test coverage detected