Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GPS location plugin #1515

Merged
merged 2 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ RUN apt-get -qq update && apt-get -o Acquire::Retries=3 -qq install -y --no-inst
apt-get -o Acquire::Retries=3 -qq update && apt-get -o Acquire::Retries=3 -qq install -y --no-install-recommends python3 python3-pip python3-setuptools python3-wheel git g++ python3-dev python2.7-dev libpq-dev binutils libproj-dev gdal-bin pdal libgdal-dev python3-gdal nginx certbot gettext-base cron postgresql-client-13 gettext tzdata && \
update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1 && update-alternatives --install /usr/bin/python python /usr/bin/python3.9 2 && \
# Install pip reqs
pip install -U pip && pip install -r requirements.txt "boto3==1.14.14" && \
pip install pip==24.0 && pip install -r requirements.txt "boto3==1.14.14" && \
# Setup cron
ln -s /webodm/nginx/crontab /var/spool/cron/crontabs/root && chmod 0644 /webodm/nginx/crontab && service cron start && chmod +x /webodm/nginx/letsencrypt-autogen.sh && \
/webodm/nodeodm/setup.sh && /webodm/nodeodm/cleanup.sh && cd /webodm && \
Expand Down
1 change: 1 addition & 0 deletions coreplugins/gpslocation/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .plugin import *
Empty file.
13 changes: 13 additions & 0 deletions coreplugins/gpslocation/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "GPS Location",
"webodmMinVersion": "0.5.0",
"description": "Add a GPS location button to the 2D map view",
"version": "1.0.0",
"author": "Piero Toffanin",
"email": "[email protected]",
"repository": "https://github.com/OpenDroneMap/WebODM",
"tags": ["gps", "location"],
"homepage": "https://github.com/OpenDroneMap/WebODM",
"experimental": false,
"deprecated": false
}
5 changes: 5 additions & 0 deletions coreplugins/gpslocation/plugin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from app.plugins import PluginBase

class Plugin(PluginBase):
def include_js_files(self):
return ['main.js']
21 changes: 21 additions & 0 deletions coreplugins/gpslocation/public/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
PluginsAPI.Map.willAddControls([
'gpslocation/node_modules/leaflet.locatecontrol/dist/L.Control.Locate.min.js',
'gpslocation/node_modules/leaflet.locatecontrol/dist/L.Control.Locate.min.css'
], function(args, _){

// TODO: how to specify consistent plugin render ordering?
// we use a timeout to make sure this button is rendered last
// but a better method is warranted
setTimeout(function(){
L.control.locate({
position: 'bottomleft',
showPopup: false,
locateOptions: {
enableHighAccuracy: true
},
strings: {
title: "Show My Location"
}
}).addTo(args.map);
}, 150);
});
14 changes: 14 additions & 0 deletions coreplugins/gpslocation/public/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "gpslocation",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"leaflet.locatecontrol": "^0.81.1"
}
}
Loading