You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Compute fuzzy local time from a location. The default accuracy is zoom level 8. See "Regenerate timezones.json" section for instructions on how to change accuracy.
varts=require('@mapbox/timespace');vartimestamp=Date.now();varpoint=[-122.27783203125,37.84015683604136];vartime=ts.getFuzzyLocalTimeFromPoint(timestamp,point);//=> (a `moment-timezone` object – see https://momentjs.com/timezone/)vartile=[41,98,8];// the tile [x, y, z] whose timezone we want to knowvartimezone1=ts.getFuzzyTimezoneFromTile(tile);//=> 'America/Los_Angeles'varquadkey='02301021';// the quadkey whose timezone we want to knowvartimezone2=ts.getFuzzyTimezoneFromQuadkey(quadkey);//=> 'America/Los_Angeles'
./lib/timezones.json file contains the timezone name of every z8 tile that contains land.
If a tile/quadkey with zoom levels > 8 is passed into timespace functions, the timezone of its z8 parent is returned.
If a tile/quadkey with zoom levels < 8 is passed into timespace functions, the most popular timezone amongst its z8 children is returned.