Your IP : 3.147.2.189


Current Path : /var/www/www-root/data/www/info.monolith-realty.ru/bitrix/js/location/source/src/
Upload File :
Current File : /var/www/www-root/data/www/info.monolith-realty.ru/bitrix/js/location/source/src/factory.js

import { BaseSource } from 'location.core';
import { Google } from 'location.google';
import { OSM, OSMFactory } from 'location.osm';

export class Factory
{
	static create(code: string, languageId: string, sourceLanguageId: string, sourceProps = {}): ?BaseSource
	{
		const props = sourceProps;
		props.languageId = languageId;
		props.sourceLanguageId = sourceLanguageId;

		if (code === Google.code)
		{
			return new Google(props);
		}
		else if (code === OSM.code)
		{
			return OSMFactory.createOSMSource(props);
		}

		return null;
	}
}