Comments (3)
Not sure if you'd call it a standard, but the current format is the OwnTracks JSON format that's universally used in the OwnTracks ecosystem: https://owntracks.org/booklet/tech/json/
I'm not interested in implementing a change for this but you might. PRs welcome :)
from frontend.
Our Recorder should produce standard GeoJSON. From our documentation:
By specifying a format we can produce GeoJSON, say. Normally, the API retrieves the last 6 hours of data but we can extend or limit this with the from and to parameters.
http://127.0.0.2:8083/map/index.html?user=demo&device=iphone&format=geojson&from=2014-01-01
So if you have access to the Recorder back-end you can try this.
from frontend.
I don't have the time to learn VueJS. -- sorry
For anyone else, I've quickly added this to the config file. (Warning, it exposes the recorder url).
(not pretty, but it does the jobs^^)
var getUrlParameter = function getUrlParameter(sParam) {
var sPageURL = window.location.search.substring(1),
sURLVariables = sPageURL.split('&'),
sParameterName,
i;
for (i = 0; i < sURLVariables.length; i++) {
sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] === sParam) {
return typeof sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]);
}
}
return false;
};
const url = "https://XXXX/api/0/locations?user=YYY&device=DDD&";
const url_recorder_viewer = "https://XXXX/map/index.html?user=YYY&device=DDDD&";
document.addEventListener('DOMContentLoaded', (event) => {
var element = document.getElementsByClassName("header-item-right")[0];
var div = document.createElement('div');
div.className = "nav-item";
div.innerHTML = `
<button title="View in recorder" class="button button-flat button-icon" onclick="view()">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-eye"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path><circle cx="12" cy="12" r="3"></circle></svg>
</button>
`
element.appendChild(div)
var div = document.createElement('div');
div.className = "nav-item";
div.innerHTML = `
<button title="Download geojson" class="button button-flat button-icon" onclick="dl_geojson()">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-download-cloud"><polyline points="8 17 12 21 16 17"></polyline><line x1="12" y1="12" x2="12" y2="21"></line><path d="M20.88 18.09A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.29"></path></svg>
</button>
`
element.appendChild(div)
})
function view() {
window.open(url_recorder_viewer + "&format=linestring&from=" + getUrlParameter('start') + "&to=" + getUrlParameter('end'), '_blank')
console.log(url_recorder_viewer + "&format=linestring&from=" + getUrlParameter('start') + "&to=" + getUrlParameter('end'))
}
// not working
function gpx_dl() {
window.open(url + "format=gpx&from=" + getUrlParameter('start') + "&to=" + getUrlParameter('end'))
console.log(url + "format=gpx&from=" + getUrlParameter('start') + "&to=" + getUrlParameter('end'))
}
function dl_geojson() {
window.open(url + "format=geojson&from=" + getUrlParameter('start') + "&to=" + getUrlParameter('end'))
console.log(url + "format=geojson&from=" + getUrlParameter('start') + "&to=" + getUrlParameter('end'))
}
from frontend.
Related Issues (20)
- URL-Encode is hindering HOT 4
- Improvement: Selection of Settings HOT 1
- Change default time span thats loaded HOT 3
- Date/time filtering is not working HOT 2
- OSM Map not loading with reverse proxy HOT 4
- Document changing of application path HOT 1
- No line segment drawn on position update HOT 2
- config.js fails with 500 when running owntracks/frontend:latest HOT 5
- Wrong order when connecting points with line (frontend does not respect timestamps correctly) HOT 3
- Container just constantly restarts HOT 4
- Can't find servers name HOT 1
- Noob Guide HOT 4
- Websockets and openstreetmaps HOT 1
- Mapbox changed its api
- Dynamic filter minAccuracy
- Frontend stopped connecting to recorder. HOT 10
- Doesn't load map element HOT 5
- Include precompiled dist/ in releases HOT 4
- Frontend doesn't show any points HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from frontend.