Skip to content

Commit

Permalink
Merge pull request #1574 from pierotofy/plotfull
Browse files Browse the repository at this point in the history
Add full screen button to plot gps map view
  • Loading branch information
pierotofy authored Dec 20, 2024
2 parents c68a5ac + 10d1ec3 commit 732d055
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
30 changes: 30 additions & 0 deletions app/static/app/js/components/MapPreview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import Standby from './Standby';
import exifr from '../vendor/exifr';
import '../vendor/leaflet/leaflet-markers-canvas';
import { _, interpolate } from '../classes/gettext';
import 'leaflet-fullscreen/dist/Leaflet.fullscreen';
import 'leaflet-fullscreen/dist/leaflet.fullscreen.css';

const Colors = {
fill: '#fff',
Expand Down Expand Up @@ -116,6 +118,34 @@ _('Example:'),
baseLayers: this.basemaps
}).addTo(this.map);

this.map.addControl(new L.Control.Fullscreen({
position: 'bottomleft'
}));

var fullscreenchange;

if ('onfullscreenchange' in document) {
fullscreenchange = 'fullscreenchange';
} else if ('onmozfullscreenchange' in document) {
fullscreenchange = 'mozfullscreenchange';
} else if ('onwebkitfullscreenchange' in document) {
fullscreenchange = 'webkitfullscreenchange';
} else if ('onmsfullscreenchange' in document) {
fullscreenchange = 'MSFullscreenChange';
}

if (fullscreenchange) {
var onFullscreenChange = L.bind(this.map._onFullscreenChange, this.map);

this.map.whenReady(function () {
L.DomEvent.on(document, fullscreenchange, onFullscreenChange);
});

this.map.on('unload', function () {
L.DomEvent.off(document, fullscreenchange, onFullscreenChange);
});
}

this.map.fitBounds([
[13.772919746115805,
45.664640939831735],
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "WebODM",
"version": "2.5.6",
"version": "2.5.7",
"description": "User-friendly, extendable application and API for processing aerial imagery.",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -47,6 +47,7 @@
"jest": "^23.4.1",
"json-loader": "^0.5.4",
"leaflet": "1.3.1",
"leaflet-fullscreen": "^1.0.2",
"object.values": "^1.0.3",
"proj4": "^2.4.3",
"qrcode.react": "^0.7.2",
Expand Down

0 comments on commit 732d055

Please sign in to comment.