| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent d01eb6e commit fc3bf02
5 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -56,8 +56,8 @@ | |||
| 56 | 56 | var excludes = (targetScript.getAttribute('exclude') || '').split(','); | |
| 57 | 57 | // 在线 | |
| 58 | 58 | if (!inArray(includes, 'ol-debug') && !inArray(includes, 'ol@4.6.5') && !inArray(excludes, 'ol')) { | |
| 59 | - inputCSS(libsurl + '/openlayers/7.5.2/ol.min.css'); | ||
| 60 | - inputScript(libsurl + '/openlayers/7.5.2/ol.js'); | ||
| 59 | + inputCSS(libsurl + '/openlayers/10.5.0/ol.min.css'); | ||
| 60 | + inputScript(libsurl + '/openlayers//10.5.0/ol.js'); | ||
| 61 | 61 | } | |
| 62 | 62 | if (inArray(includes, 'ol@4.6.5')) { | |
| 63 | 63 | inputCSS(libsurl + '/openlayers/4.6.5/ol.css'); | |
@@ -83,7 +83,7 @@ | |||
| 83 | 83 | inputScript(libsurl + '/proj4/2.17.0/proj4.min.js'); | |
| 84 | 84 | } | |
| 85 | 85 | if (inArray(includes, 'ol3-echarts')) { | |
| 86 | - inputScript(libsurl + '/openlayers/ol3-echarts/4.0.1-1/ol-echarts.js'); | ||
| 86 | + inputScript(libsurl + '/openlayers/ol3-echarts/4.0.2/ol-echarts.min.js'); | ||
| 87 | 87 | } | |
| 88 | 88 | if (inArray(includes, 'ol3-echarts@1.3.6')) { | |
| 89 | 89 | inputScript(libsurl + '/openlayers/ol3-echarts/1.3.6/ol3Echarts.min.js'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -167,7 +167,7 @@ | |||
| 167 | 167 | "maplibre-gl": "5.6.0", | |
| 168 | 168 | "mapv": "2.0.62", | |
| 169 | 169 | "node-forge": "^1.3.1", | |
| 170 | - "ol": "7.5.2", | ||
| 170 | + "ol": "10.5.0", | ||
| 171 | 171 | "pbf": "3.2.1", | |
| 172 | 172 | "proj4": "2.17.0", | |
| 173 | 173 | "promise-polyfill": "8.2.3", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,7 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | 5 | import Scale from 'ol/control/ScaleLine'; | |
| 6 | 6 | import * as olProj from 'ol/proj'; | |
| 7 | - import AssertionError from 'ol/AssertionError'; | ||
| 8 | 7 | ||
| 9 | 8 | /** | |
| 10 | 9 | * @class ScaleLine | |
@@ -119,7 +118,7 @@ export class ScaleLine extends Scale { | |||
| 119 | 118 | pointResolution /= 1609.3472; | |
| 120 | 119 | } | |
| 121 | 120 | } else { | |
| 122 | - throw new AssertionError(33); // Invalid units | ||
| 121 | + throw new Error('Invalid units');// Invalid units | ||
| 123 | 122 | } | |
| 124 | 123 | var DIGITS = [1, 2, 5]; | |
| 125 | 124 | let i = 3 * Math.floor( | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19,7 +19,7 @@ | |||
| 19 | 19 | "@supermapgis/tile-decryptor": "^1.0.0", | |
| 20 | 20 | "@turf/turf": "7.2.0", | |
| 21 | 21 | "mapv": "2.0.62", | |
| 22 | - "ol": "7.5.2", | ||
| 22 | + "ol": "10.5.0", | ||
| 23 | 23 | "canvg": "^4.0.3", | |
| 24 | 24 | "lodash.clonedeep": "^4.5.0", | |
| 25 | 25 | "lodash.remove": "^4.7.0", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -88,4 +88,20 @@ describe('openlayers_ScaleLine', () => { | |||
| 88 | 88 | expect(scaleControl.element.style.display).toBe('none'); | |
| 89 | 89 | done(); | |
| 90 | 90 | }); | |
| 91 | + | ||
| 92 | + it('test updateElementRepair error', (done) => { | ||
| 93 | + var scaleControl = new ScaleLine(); | ||
| 94 | + map.addControl(scaleControl); | ||
| 95 | + map.once('postrender', () => { | ||
| 96 | + setTimeout(() => { | ||
| 97 | + try { | ||
| 98 | + scaleControl.setUnits('error'); | ||
| 99 | + scaleControl.updateElementRepair(); | ||
| 100 | + } catch (error) { | ||
| 101 | + expect(error.message).toBe('Invalid units'); | ||
| 102 | + done(); | ||
| 103 | + } | ||
| 104 | + }, 100); | ||
| 105 | + }); | ||
| 106 | + }); | ||
| 91 | 107 | }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments