Commit ac9e7dd 1 parent 3f2abc0 commit ac9e7dd Copy full SHA for ac9e7dd
File tree 3 files changed +8
-3
lines changed
3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 1
- {}
1
+ []
Original file line number Diff line number Diff line change 8
8
< script type ="module " src ="https://unpkg.com/little-planet@0.6.2 "> </ script >
9
9
< script src ="https://unpkg.com/leaflet@1.8.0/dist/leaflet.js "> </ script >
10
10
< script src ="https://unpkg.com/leaflet.markercluster@1.4.1 "> </ script >
11
- < script src ="https://stamen-maps.a.ssl.fastly.net/js/tile.stamen.js?v1.3.0 "> </ script >
12
11
13
12
< link rel ="stylesheet " href ="https://unpkg.com/leaflet@1.8.0/dist/leaflet.css " />
14
13
< link rel ="stylesheet " href ="https://unpkg.com/leaflet.markercluster@1.4.1/dist/MarkerCluster.css " />
Original file line number Diff line number Diff line change @@ -112,7 +112,13 @@ async function init() {
112
112
113
113
map . addLayer ( topo ) ;
114
114
map . addLayer ( group ) ;
115
- map . fitBounds ( group . getBounds ( ) ) ;
115
+
116
+ let bounds = group . getBounds ( ) ;
117
+ if ( bounds . isValid ( ) ) {
118
+ map . fitBounds ( bounds ) ;
119
+ } else {
120
+ map . setView ( [ 0 , 0 ] , 2 ) ;
121
+ }
116
122
117
123
fromURL ( data ) ;
118
124
}
You can’t perform that action at this time.
0 commit comments