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 intendedHeight = frame.args['intendedHeight'] 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 offset_l = math.floor((bounding_box_left/originalWidth)*bSize) local offset_t = math.floor((bounding_box_top/originalHeight)*intendedHeight) 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