Open maddan opened 5 years ago
If I understood your question correctly, you need to extract the exact time on the display bar?
It's a simple need, intuitively, but made me ponder over it for a few days. The timeDimension is super attractive but anything slightly out of the ordinary comes with a price.
Anyways, try the following: (1) use the moment js lib for formatting purposes You may find on CDN or drop me an email cdnjs.cloudflare.com/ajax/libs/moment.js/2.7.0/moment.min.js
(2) extract/format the date as suited to your needs:
map.timeDimension.on('timeload', function (data) { var nowTime = map.timeDimension.getCurrentTime(); var tzoffset = (new Date()).getTimezoneOffset() * 60000; var localISOTime = (new Date(new Date(nowTime) - tzoffset)).toISOString().slice(0, -1); _this_YYYY_MM_DD_stamp = moment(localISOTime).format(returnDateFormat_YYYY_MM_DD_dataFetch);}, this);
BTW, I am also conceptualizing an Ocean Viewer for NOAA.
Hope this helps.
You are right! It looks great to use it but really hard to customize it. Let me try your suggestion. Thanks!
Hi, I'm using Leaflet framework. For weather data, I'm using Open Weather Map api. However, for the slider I'm using nowCoast (NOAA). I'm using the Leaflet.TimeDimension and while dragging the slider, I have to update the marker metadata in my map. How do I do that? Did I miss any important documentation? Please help.
Here's my Leaflet map instance:
Based on where the user slides, I need to update my marker (weather data) as I slide the slider given that timestamp.