Skip to content

Commit 09a109b

Browse files
author
Judy Zhu
committed
merge
1 parent ce4a793 commit 09a109b

File tree

776 files changed

+109793
-6122
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

776 files changed

+109793
-6122
lines changed

build/build.bat

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,7 @@ call npm install uglify-js -g
55
call npm run build
66
call copy style "dist"
77
call copy README.md "dist"
8-
move dist\ol.mapsuite.js %~pd0compression
9-
copy src\ol %~pd0compression
10-
cd %~pd0compression
11-
call npm link
12-
call merge.bat
13-
call move vectormap-dev.js ../../dist
14-
call compression.bat
15-
call move vectormap.js ../../dist
16-
del /q /s *^ol*
8+
179

1810

1911

debug/index.html

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<!DOCTYPE html>
2+
<html>
3+
4+
<head>
5+
<meta charset="utf-8">
6+
<title>Using OpenLayers with Webpack</title>
7+
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
8+
<link rel="stylesheet" href="ol.css" type="text/css">
9+
<script src="./webfontloader.js"></script>
10+
<script>
11+
WebFont.load({
12+
custom: {
13+
families: ["vectormap-icons"],
14+
urls: ["https://cdn.thinkgeo.com/vectormap-icons/1.0.0/vectormap-icons.css"]
15+
}
16+
});
17+
</script>
18+
<style>
19+
html,
20+
body {
21+
margin: 0;
22+
height: 100%;
23+
}
24+
25+
#map {
26+
position: absolute;
27+
top: 0;
28+
bottom: 0;
29+
width: 100%;
30+
}
31+
32+
#olzoom {
33+
position: absolute;
34+
z-index: 1000;
35+
top: 10.5em;
36+
left: .5em;
37+
}
38+
39+
#canvasSize {
40+
position: absolute;
41+
z-index: 1000;
42+
top: 6.5em;
43+
left: .5em;
44+
}
45+
</style>
46+
</head>
47+
48+
<body>
49+
<label id="olzoom"></label>
50+
<!-- <label id="canvasSize"></label> -->
51+
<div id="map"></div>
52+
<script src="../dist/vectormap-dev.js"></script>
53+
<script src="thinkgeo-world-streets-light.js"></script>
54+
<script src="index.js"></script>
55+
</body>
56+
57+
</html>

debug/index.js

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
let layer = new ol.mapsuite.VectorTileLayer(light, {
2+
multithread: true
3+
});
4+
5+
var tilegrid = new ol.layer.Tile({
6+
source: new ol.source.TileDebug({
7+
projection: "EPSG:3857",
8+
tileGrid: ol.tilegrid.createXYZ({ tileSize: 512, maxZoom: 22 })
9+
})
10+
})
11+
12+
var style = new ol.style.Style({
13+
text: new ol.style.Text({
14+
font: 'bold 11px "Open Sans", "Arial Unicode MS", "sans-serif"',
15+
placement: 'line',
16+
fill: new ol.style.Fill({
17+
color: '#cccccc'
18+
})
19+
})
20+
});
21+
22+
var vectorTileLayer = new ol.layer.VectorTile({
23+
updateWhileAnimating: true,
24+
updateWhileInteracting: true,
25+
source: new ol.source.VectorTile({
26+
format: new ol.format.MVT({
27+
}),
28+
url: "https://cloud1.thinkgeo.com/api/v1/maps/vector/streets/3857/{z}/{x}/{y}.pbf?apiKey=Yy6h5V0QY4ua3VjqdkJl7KTXpxbKgGlFJWjMTGLc_8s~"
29+
}),
30+
declutter: true
31+
})
32+
33+
34+
var view = new ol.View({
35+
center: [-10775718.490585351, 3868389.0226015863],
36+
zoom: 4,
37+
maxZoom: 19,
38+
maxResolution: 40075016.68557849 / 512,
39+
progressiveZoom: true
40+
});
41+
var zoom = view.getZoom();
42+
document.getElementById("olzoom").innerHTML = "Zoom:" + (zoom);
43+
view.on("change:resolution", function (e) {
44+
var zoom = view.getZoom();
45+
if ((zoom.toString()).indexOf(".") > 0) {
46+
zoom = zoom.toFixed(2);
47+
}
48+
document.getElementById("olzoom").innerHTML = "Zoom:" + (zoom);
49+
});
50+
51+
var map = new ol.Map({
52+
target: 'map',
53+
layers: [
54+
layer
55+
],
56+
view: view,
57+
loadTilesWhileInteracting: true
58+
});

debug/ol.css

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)