Skip to content

Commit

Permalink
Merge branch 'release/1.14.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniil Dubrava committed Jun 30, 2020
2 parents 9b4344e + e55a249 commit d60a412
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 8 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog
All notable changes from v1.0.0 will be documented in this file.

## [1.14.5] - 2020-06-30
### Added
- Support for enterprise API

## [1.14.4] - 2020-06-29
### Fixed
- Build erorr
Expand Down Expand Up @@ -151,6 +155,7 @@ All notable changes from v1.0.0 will be documented in this file.
## [1.0.0] - 2019-09-14
- Release without changes

[1.14.4]: https://github.com/ddubrava/angular-yandex-maps/compare/v1.14.4...v1.14.5
[1.14.4]: https://github.com/ddubrava/angular-yandex-maps/compare/v1.14.3...v1.14.4
[1.14.3]: https://github.com/ddubrava/angular-yandex-maps/compare/v1.14.2...v1.14.3
[1.14.2]: https://github.com/ddubrava/angular-yandex-maps/compare/v1.14.1...v1.14.2
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "angular-yandex-maps",
"version": "1.14.4",
"version": "1.0.0",
"scripts": {
"start": "ng serve",
"build": "ng build angular8-yandex-maps",
"build": "npm run lint && ng build angular8-yandex-maps",
"lint": "ng lint angular8-yandex-maps"
},
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion projects/angular8-yandex-maps/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular8-yandex-maps",
"version": "1.14.3",
"version": "1.14.5",
"description": "Angular module for Yandex.Maps",
"repository": {
"type": "git",
Expand Down
1 change: 1 addition & 0 deletions projects/angular8-yandex-maps/src/lib/models/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { InjectionToken } from '@angular/core';
export interface IConfig {
apikey: string;
lang: 'ru_RU' | 'en_US' | 'en_RU' | 'ru_UA' | 'uk_UA' | 'tr_TR';
enterprise?: boolean;
coordorder?: 'latlong' | 'longlat';
load?: string;
mode?: 'release' | 'debug';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ export class YandexMapService implements IYandexMapService {
public initScript(): Observable<any> {
if (!this._scriptYmaps) {
const ymapScript = this.document.createElement('script');
const params = this._getQueryParams(this._config);

ymapScript.src = `https://api-maps.yandex.ru/2.1/?${params}`;
this._createSrc(ymapScript);
this._scriptYmaps = this.document.body.appendChild(ymapScript);
}

Expand All @@ -49,7 +48,15 @@ export class YandexMapService implements IYandexMapService {
);
}

private _createSrc(script: HTMLScriptElement): void {
const params = this._getQueryParams(this._config);
const { enterprise } = this._config;

script.src = `https://${enterprise ? 'enterprise.' : ''}api-maps.yandex.ru/2.1/?${params}`;
}

private _getQueryParams(params: {}): string {
return Object.keys(params).map((key: string) => `${key}=${params[key]}`).join('&');
}

}
3 changes: 1 addition & 2 deletions tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
"arrow-parameter",
"property-declaration",
"variable-declaration-ignore-function",
"object-destructuring",
"array-destructuring"
]
}
}
}

0 comments on commit d60a412

Please sign in to comment.