Skip to content

Commit 2989a56

Browse files
committed
new test version
1 parent 3167d3c commit 2989a56

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/reload-test/index.html

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
<link rel="shortcut icon" type="image/png" href="../favicon.png" />
88
<link href="https://api.mapbox.com/mapbox-gl-js/v3.10.0/mapbox-gl.css" rel="stylesheet">
99
<script src="https://api.mapbox.com/mapbox-gl-js/v3.10.0/mapbox-gl.js"></script>
10-
<script src="https://mapgl.2gis.com/api/js/v1"></script>
10+
<script src="./mapgl.js"></script>
11+
<!-- <script src="https://mapgl.2gis.com/api/js/v1"></script> -->
1112
<title>Reload comparsion between MapGL and Mapbox</title>
1213
<meta name="description" content="Reload comparsion between MapGL and Mapbox" />
1314
<meta name="category" content="hidden" />
@@ -41,7 +42,9 @@
4142
<div id="map"></div>
4243

4344
<script>
44-
mapboxgl.accessToken = 'pk.eyJ1IjoiaXRhbmthOSIsImEiOiJjam0zYTh1ZnYwMWN5M3ZucmE3cjRidDdyIn0.hZr8xq9GeFsfTViMiQZdUg';
45+
if (window.mapboxgl) {
46+
window.mapboxgl.accessToken = 'pk.eyJ1IjoiaXRhbmthOSIsImEiOiJjam0zYTh1ZnYwMWN5M3ZucmE3cjRidDdyIn0.hZr8xq9GeFsfTViMiQZdUg';
47+
}
4548

4649
let map;
4750

@@ -56,11 +59,13 @@
5659
}
5760
if (map) {
5861
map.destroy();
62+
map = undefined;
5963
}
6064

6165
map = window.map = new mapgl.Map('map', {
6266
center: [37.62708, 55.750471],
63-
key: 'a1893935-6834-4445-b97a-3405fb426c5b',
67+
key: '4970330e-7f1c-4921-808c-0eb7c4e63001',
68+
// key: 'a1893935-6834-4445-b97a-3405fb426c5b',
6469
zoom: 16,
6570
});
6671
}
@@ -73,6 +78,7 @@
7378
}
7479
if (map) {
7580
map.destroy();
81+
map = undefined;
7682
}
7783
}
7884

src/reload-test/mapgl.js

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)