(projection)
| 1497 | return Promise.allSettled(layersReady); |
| 1498 | } |
| 1499 | whenProjectionDefined(projection) { |
| 1500 | return new Promise((resolve, reject) => { |
| 1501 | let interval, failureTimer; |
| 1502 | if (M[projection]) { |
| 1503 | resolve(); |
| 1504 | } else { |
| 1505 | interval = setInterval(testForProjection, 200, projection); |
| 1506 | failureTimer = setTimeout(projectionNotDefined, 5000); |
| 1507 | } |
| 1508 | function testForProjection(p) { |
| 1509 | if (M[p]) { |
| 1510 | clearInterval(interval); |
| 1511 | clearTimeout(failureTimer); |
| 1512 | resolve(); |
| 1513 | } |
| 1514 | } |
| 1515 | function projectionNotDefined() { |
| 1516 | clearInterval(interval); |
| 1517 | clearTimeout(failureTimer); |
| 1518 | reject('Timeout reached waiting for projection to be defined'); |
| 1519 | } |
| 1520 | }); |
| 1521 | } |
| 1522 | geojson2mapml(json, options = {}) { |
| 1523 | if (options.projection === undefined) { |
| 1524 | options.projection = this.projection; |
no outgoing calls
no test coverage detected