calculate x position with postion:relative and width/maxWidth

An attempt at resolving issue #1670. See also: mapbox/mapbox.js#383