changed offset and resolution to use the map metadata