(projection)
| 1454 | return Promise.allSettled(layersReady); |
| 1455 | } |
| 1456 | whenProjectionDefined(projection) { |
| 1457 | return new Promise((resolve, reject) => { |
| 1458 | let interval, failureTimer; |
| 1459 | if (M[projection]) { |
| 1460 | resolve(); |
| 1461 | } else { |
| 1462 | interval = setInterval(testForProjection, 200, projection); |
| 1463 | failureTimer = setTimeout(projectionNotDefined, 5000); |
| 1464 | } |
| 1465 | function testForProjection(p) { |
| 1466 | if (M[p]) { |
| 1467 | clearInterval(interval); |
| 1468 | clearTimeout(failureTimer); |
| 1469 | resolve(); |
| 1470 | } |
| 1471 | } |
| 1472 | function projectionNotDefined() { |
| 1473 | clearInterval(interval); |
| 1474 | clearTimeout(failureTimer); |
| 1475 | reject('Timeout reached waiting for projection to be defined'); |
| 1476 | } |
| 1477 | }); |
| 1478 | } |
| 1479 | geojson2mapml(json, options = {}) { |
| 1480 | if (options.projection === undefined) { |
| 1481 | options.projection = this.projection; |
no outgoing calls
no test coverage detected