addTo(container, flatten, setViewportBounds) {
		const _sort = container.autoSort;
		const _depth = container.autoDepth;

		const levelBounds = this.getBounds();

		// disable auto-sort and auto-depth
		container.autoSort = false;
		container.autoDepth = false;

		if (this.backgroundcolor) {
			container.backgroundColor.parseCSS(this.backgroundcolor);
		}

		// add all layers instances
		this.getLayers().forEach((layer) => {
			container.addChild(layer);
		});

		// add all Object instances
		this.getObjects(flatten).forEach((object) => {
			container.addChild(object);
		});

		// resize the container accordingly
		container.resize(this.bounds.width, this.bounds.height);

		// sort everything (recursively)
		container.sort(true);

		/**
		 * callback funtion for the viewport resize event
		 * @ignore
		 */
		function _setBounds(width, height) {
			// adjust the viewport bounds if level is smaller
			game.viewport.setBounds(
				0,
				0,
				Math.max(levelBounds.width, width),
				Math.max(levelBounds.height, height),
			);
			// center the map if smaller than the current viewport
			container.pos.set(
				Math.max(0, ~~((width - levelBounds.width) / 2)),
				Math.max(0, ~~((height - levelBounds.height) / 2)),
				// don't change the container z position if defined
				container.pos.z,
			);
		}

		if (setViewportBounds === true) {
			eventEmitter.removeListener(VIEWPORT_ONRESIZE, _setBounds);
			// force viewport bounds update
			_setBounds(game.viewport.width, game.viewport.height);
			// Replace the resize handler
			eventEmitter.addListener(VIEWPORT_ONRESIZE, _setBounds);
		}

		//  set back auto-sort and auto-depth
		container.autoSort = _sort;
		container.autoDepth = _depth;
	}
add all the map layers and objects to the given container.
note : this will not automatically update the camera viewport
@param {Container} container - target container
@param {boolean} [flatten=true] - if true, flatten all objects into the given container, else a `me.Container` object will be created for each corresponding groups
@param {boolean} [setViewportBounds=false] - if true, set the viewport bounds to the map size, this should be set to true especially if adding a level to the game world container.
@example
// create a new level object based on the TMX JSON object
let level = new me.TMXTileMap(levelId, me.loader.getTMX(levelId));
// add the level to the game world container
level.addTo(me.game.world, true, true);