Skip to content

Commit 2a73ca6

Browse files
committed
【update】 openlayers 矢量瓦片地址 ol 依赖换为 ol4
1 parent 6be924f commit 2a73ca6

File tree

5 files changed

+8
-12
lines changed

5 files changed

+8
-12
lines changed

examples/openlayers/mvtvectorlayer_mbstyle_4326.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<meta charset="UTF-8">
99
<title data-i18n="resources.title_mvtVectorLayer"></title>
1010
<script type="text/javascript" src="../js/include-web.js"></script>
11-
<script type="text/javascript" include='ol-mapbox-style' src="../../dist/ol/include-ol.js"></script>
11+
<script type="text/javascript" include='ol-debug,ol-mapbox-style' src="../../dist/ol/include-ol.js"></script>
1212
<style>
1313
.ol-popup {
1414
position: absolute;
@@ -71,9 +71,8 @@
7171
map.addControl(info);
7272
var format = new ol.format.MVT({
7373
featureClass: ol.Feature
74-
7574
});
76-
// format.dataProjection = new ol.proj.Projection({
75+
// format.defaultDataProjection = new ol.proj.Projection({
7776
// code: 'EPSG:4326',
7877
// units: ol.proj.Units.TILE_PIXELS
7978
// });

examples/openlayers/mvtvectorlayer_mbstyle_beijing.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@
114114
});
115115
</script>
116116
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
117-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.1.1/css/ol.css">
118-
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.1.1/build/ol.js"></script>
117+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/openlayers/4.6.5/ol-debug.css">
118+
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/openlayers/4.6.5/ol-debug.js"></script>
119119
<script type="text/javascript" src="https://iclient.supermap.io/web/libs/openlayers/plugins/ol-mapbox-style/2.11.2/olms.js"></script>
120120
<script type="text/javascript" src="../../dist/ol/iclient-ol-es6.min.js"></script>
121121
<link rel="stylesheet" href="../../dist/ol/iclient-ol.min.css">

examples/openlayers/mvtvectorlayer_mbstyle_landuse.html

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<head>
88
<meta charset="UTF-8">
99
<title data-i18n="resources.title_mvtVectorLayer_mapboxStyle_landuse"></title>
10-
<script type="text/javascript" include='ol-mapbox-style,proj4' src="../../dist/ol/include-ol.js"></script>
10+
<script type="text/javascript" include='ol-debug,ol-mapbox-style,proj4' src="../../dist/ol/include-ol.js"></script>
1111
<style>
1212
.ol-popup {
1313
position: absolute;
@@ -35,8 +35,6 @@
3535
proj4.defs("EPSG:2362",
3636
"+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=38500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs "
3737
);
38-
// ol5及ol5以上版本废除 ol.proj.setProj4 接口,新增 register 接口注册 proj4
39-
ol.proj.proj4.register(proj4);
4038
getResolutions = function (zoom, scale, targetMinZoom, targetMaxZoom) {
4139
var res = scaleToResolution(scale);
4240
var minRes = res * Math.pow(2, zoom - targetMinZoom);
@@ -64,8 +62,7 @@
6462
minZoom: 11,
6563
maxZoom: 15,
6664
projection: projection,
67-
resolutions: resolutions,
68-
multiWorld: true
65+
resolutions: resolutions
6966
})
7067
});
7168
var container = document.getElementById('popup');

examples/openlayers/mvtvectorlayer_mbstyle_linestyle.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<head>
88
<!-- <meta charset="UTF-8"> -->
99
<title data-i18n="resources.title_mvtVectorLayer_mapboxStyle_lineStyle"></title>
10-
<script type="text/javascript" include='ol-mapbox-style' src="../../dist/ol/include-ol.js"></script>
10+
<script type="text/javascript" include='ol-debug,ol-mapbox-style' src="../../dist/ol/include-ol.js"></script>
1111
<style>
1212
ol {
1313
list-style: none;

examples/openlayers/mvtvectorlayer_vectortilerest.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<meta charset="UTF-8">
99
<title data-i18n="resources.title_mvtVectorLayer_vectortilerest"></title>
1010
<script type="text/javascript" src="../js/include-web.js"></script>
11-
<script type="text/javascript" include='ol-mapbox-style' src="../../dist/ol/include-ol.js"></script>
11+
<script type="text/javascript" include='ol-debug,ol-mapbox-style' src="../../dist/ol/include-ol.js"></script>
1212
<style>
1313
.ol-popup {
1414
position: absolute;

0 commit comments

Comments
 (0)