Skip to content

Commit fcbb959

Browse files
committed
feat: change fullscreen to web full
1 parent b1ec484 commit fcbb959

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

_posts/2021-11-17-picture-gps.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@
2626
flex: 1;
2727
}
2828

29-
.fullscreen{
29+
.map-ctn{
30+
height:100%;
31+
}
32+
33+
.fullscreen-btn{
3034
position: absolute;
3135
z-index: 1;
3236
color: #e6e6e6;
@@ -78,15 +82,24 @@
7882
display: block;
7983
}
8084
}
85+
.fullscreen{
86+
position: fixed;
87+
top:0;
88+
left:0;
89+
right:0;
90+
bottom:0;
91+
}
8192
</style>
8293
<script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.15&key=05fb23d2c6d3ce6323793cd981030e9f&plugin=AMap.Geocoder"></script>
8394
<script src="/resource/2018/exif.js"></script>
8495
<script src="/resource/2021/gpsConvert.js"></script>
8596

8697
<div class="gps-container">
8798
<h2>把图片拖进来</h2>
88-
<div class="container" id="mapCtn">
89-
<div class="fullscreen">全屏</div>
99+
<div class="container">
100+
<div class="map-ctn" id="mapCtn">
101+
<div class="fullscreen-btn">全屏</div>
102+
</div>
90103
</div>
91104
<div id="makeAndModel" style="height: 30px; "></div>
92105
<footer>

resource/2021/1117_gps.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ function gps2Google(gpsCoord) {
1515
var pageControl = {
1616
init: function () {
1717
const mapContainer = $("#mapCtn");
18-
const fullBtn = $(".fullscreen");
18+
const fullBtn = $(".fullscreen-btn");
1919
const btnAmapTile = $("#btnAmapTile");
2020
const btnGoogleTile = $("#btnGoogleTile");
2121

2222
fullBtn.addEventListener("click", () => {
23+
$(".container").classList.toggle("fullscreen");
24+
return;
2325
if (document.fullscreenElement) {
2426
document.exitFullscreen();
2527
return;
@@ -36,7 +38,7 @@ var pageControl = {
3638
"http://mt2.google.com/vt/lyrs=y&hl=zh-CN&gl=cn&x=[x]&y=[y]&z=[z]&s=Galil",
3739
zIndex: 3,
3840
});
39-
this.googleLayer=googleLayer;
41+
this.googleLayer = googleLayer;
4042

4143
const amapSatelliteLayer = new AMap.TileLayer.Satellite();
4244
const amapRoadNetLayer = new AMap.TileLayer.RoadNet();
@@ -45,7 +47,6 @@ var pageControl = {
4547
resizeEnable: true,
4648
zoom: 15,
4749
center: [116.397428, 39.90923],
48-
4950
});
5051

5152
const testGoogleImage = new Image();

0 commit comments

Comments
 (0)