Skip to content

Commit 2811058

Browse files
authored
Merge pull request #1044 from openlayers/units-from-ol
Use direct import of METERS_PER_UNIT for legacy build compatibility
2 parents 31023b0 + f383fd2 commit 2811058

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/apply.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,7 @@ import VectorTileLayer from 'ol/layer/VectorTile.js';
2121
import VectorTileSource, {defaultLoadFunction} from 'ol/source/VectorTile.js';
2222
import View from 'ol/View.js';
2323
import derefLayers from '@mapbox/mapbox-gl-style-spec/deref.js';
24-
import {
25-
METERS_PER_UNIT,
26-
equivalent,
27-
fromLonLat,
28-
get as getProjection,
29-
getUserProjection,
30-
} from 'ol/proj.js';
24+
import {METERS_PER_UNIT} from 'ol/proj/Units.js';
3125
import {
3226
_colorWithOpacity,
3327
stylefunction as applyStyleFunction,
@@ -48,6 +42,12 @@ import {
4842
getTileJson,
4943
getZoomForResolution,
5044
} from './util.js';
45+
import {
46+
equivalent,
47+
fromLonLat,
48+
get as getProjection,
49+
getUserProjection,
50+
} from 'ol/proj.js';
5151
import {getFonts} from './text.js';
5252
import {getTopLeft} from 'ol/extent.js';
5353
import {hillshade} from './shaders.js';

test/test.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
<html>
33
<head>
44
<title>Test of the standalone build</title>
5-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.14.1/css/ol.css">
5+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/ol.css">
66
</head>
77
<body>
88
<div id="map" style="height: 300px; width:300px;"></div>
9-
<script src="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.14.1/build/ol.js"></script>
9+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/ol.js"></script>
1010
<script src="../dist/olms.js"></script>
1111
<script>
1212
olms.apply('map', ' https://demo.tegola.io/styles/hot-osm.json');

0 commit comments

Comments
 (0)