hallahan / LeafletPlayback

This is a Leaflet plug-in that plays back points that have a time stamp synchronized to a clock.
http://leafletplayback.theoutpost.io
Other
481 stars 165 forks source link

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

Open frasser opened 5 years ago

frasser commented 5 years ago

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 commented 4 years ago

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 :)