public function finalize($return = false) {
		$script = $this->_arrayToObject('matching', $this->matching, false, true) . PHP_EOL;
		$script .= $this->_arrayToObject('gIcons' . static::$mapCount, $this->icons, false, false) . '

	jQuery(document).ready(function() {
		';

		$script .= $this->map;
		if ($this->_runtimeConfig['geolocate']) {
			$script .= $this->_geolocate();
		}

		if ($this->_runtimeConfig['showMarker'] && !empty($this->markers) && is_array($this->markers)) {
			$script .= implode($this->markers, ' ');
		}

		if ($this->_runtimeConfig['autoCenter']) {
			$script .= $this->_autoCenter();
		}
		$script .= '

	});';
		static::$mapCount++;
		if ($return) {
			return $script;
		}
		$this->Html->scriptBlock($script, ['block' => true]);
	}