-
-
Notifications
You must be signed in to change notification settings - Fork 993
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1515 from pierotofy/gpsloc
Add GPS location plugin
- Loading branch information
Showing
7 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .plugin import * |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |