index.js
function determineVersion(json) {
	var version = 'unknown';
	if (json) {
		if (json.WMS_Capabilities) {
			if (json.WMS_Capabilities.$) {
				if (json.WMS_Capabilities.$.version) {
					version = json.WMS_Capabilities.$.version;
				}
			}
		} else {
			if (json.WMT_MS_Capabilities) {
				if (json.WMT_MS_Capabilities.$) {
					if (json.WMT_MS_Capabilities.$.version) {
						version = json.WMT_MS_Capabilities.$.version;
					}
				}
			}
		}
	}
	return version;
}
function determineVersion(json) {
	var version = 'unknown';
	if (json) {
		if (json.WMS_Capabilities) {
			if (json.WMS_Capabilities.$) {
				if (json.WMS_Capabilities.$.version) {
					version = json.WMS_Capabilities.$.version;
				}
			}
		} else {
			if (json.WMT_MS_Capabilities) {
				if (json.WMT_MS_Capabilities.$) {
					if (json.WMT_MS_Capabilities.$.version) {
						version = json.WMT_MS_Capabilities.$.version;
					}
				}
			}
		}
	}
	return version;
}
function determineVersion ( json ) { var version = 'unknown' ; if ( json ) { if ( json . WMS_Capabilities ) { if ( json . WMS_Capabilities . $ ) { if ( json . WMS_Capabilities . $ . version ) { version = json . WMS_Capabilities . $ . version ; } } } else { if ( json . WMT_MS_Capabilities ) { if ( json . WMT_MS_Capabilities . $ ) { if ( json . WMT_MS_Capabilities . $ . version ) { version = json . WMT_MS_Capabilities . $ . version ; } } } } } return version ; }
It determines the version of GetCapabilities document.

@param json
{object} GetCapabilities document as JSON.
@returns {String} Version of GetCapabilities document. If the version can't
determined, it will return 'unknown'.
It determines the version of GetCapabilities document .