map.on('mousemove', function (e) {
map.getCanvas().style.cursor = ''
// Need to check if markers layer is ready to query else
// I get Type error the first few seconds when you move the mouse.
var features = map.queryRenderedFeatures(e.point, {layers: ['markers']})
if (!features.length) return;
map.getCanvas().style.cursor = 'pointer'
});
Its not clear to me how I can check if map has completed rendering. The above code will give error while still rendering the map.