Module:Cropped Map Composite

local p = {} --p stands for package

function p.hello( frame ) -- Retrieve the original arguments local originalWidth = frame.args['originalWidth'] local originalHeight = frame.args['originalHeight'] local intendedWidth = frame.args['intendedWidth'] local bounding_box_left = frame.args['left'] local bounding_box_right = frame.args['right'] local bounding_box_top = frame.args['top'] local bounding_box_bottom = frame.args['bottom'] local float_x = frame.args['x'] local float_y = frame.args['y'] -- Do some calculations local bounding_box_width = bounding_box_right - bounding_box_left local bounding_box_height = bounding_box_bottom - bounding_box_top local bSize = math.floor((intendedWidth/bounding_box_width)*originalWidth) local intendedHeight = math.floor((bounding_box_height/bSize)*intendedWidth) local offset_l = math.floor((bounding_box_left/bSize)*intendedWidth) local offset_t = math.floor((bounding_box_top/bSize)*intendedWidth) float_x = math.floor((float_x/bounding_box_width)*intendedWidth)-5 float_y = math.floor((float_y/bounding_box_height)*intendedHeight)-5 local mapOverlay = "\n \n\n  \n "

local superimpose = "" .. mapOverlay .. "\n \n " return superimpose end

return p