port https://github.com/mapbox/mapbox-gl-js/commit/954dc6591fb6bef812881daf686ab3164d259ea6
port https://github.com/mapbox/mapbox-gl-js/commit/5a9a1b14b94b18277c4495199dc19e0cb96619fc