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

i can't load data to L.Playback(); #70

Open
frasser opened this issue Dec 19, 2018 · 2 comments
Open

i can't load data to L.Playback(); #70

frasser opened this issue Dec 19, 2018 · 2 comments

Comments

@frasser
Copy link

frasser commented Dec 19, 2018

hi everybody, i have some problems at moment to load my data with cords and tie from xml . this is my issue:
geo = {
"type": "Feature",
"geometry": {
"type": "MultiPoint",
"coordinates": []
},
"properties": {
"time": []
}
};
t = L.Playback.Util.ParseGPX(geo);
t.geometry.coordinates = cor;
t.properties.time = fech;

when i check de console.log(t); can see the data the obj t as i want

bbox: Array []

geometry: {…}
​​
coordinates: (3) […]
​​​
0: Array [ -76.491099, 3.48861 ]
​​​
1: Array [ -76.546984, 3.483693 ]
​​​
2: Array [ -76.489434, 3.473348 ]
​​​
length: 3
​​​
: Array []
​​
type: "MultiPoint"
​​
: Object { … }

properties: {…}
​​
altitude: Array []
​​
speed: Array []
​​
time: Array(3) [ 1529525230000, 1542210423000, 1542210907000 ]
​​
: Object { … }

type: "Feature"

: Object { … }

next, try to initialize the playback

var playback = new L.Playback(mapaEventos,t, null, playbackOptions);

but i receibe this issue about empty data at start,end and I have no idea why does not read me the data that loads.

err: cant interpolate a point LeafletPlayback.min.js:1:4764
Array [ "start", undefined ]
LeafletPlayback.min.js:1:4809
Array [ "end", undefined ]
LeafletPlayback.min.js:1:4834
Array [ "ratio", NaN ]

can someone give me some advice to solve this, please

@forestDev
Copy link

Hello, i guess you shouldn't use L.Playback.Util.ParseGPX(geo);, just geo.geometry.coordinates = cor; geo.properties.time = fech;, you need only give coordinates and time to geo. I hope it resolve your problem :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@frasser @forestDev and others