Skip to content

Commit

Permalink
2.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
leftstick committed Nov 11, 2016
1 parent 6b545bd commit 8b6572d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions dist/angular2-baidu-map.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ declare module 'angular2-baidu-map' {
import { PreviousMarker } from 'angular2-baidu-map/interfaces/PreviousMarker';
export class BaiduMap implements OnInit, OnChanges {
ak: string;
protocol: string;
options: MapOptions;
offlineOpts: OfflineOptions;
onMapLoaded: EventEmitter<{}>;
Expand Down
11 changes: 8 additions & 3 deletions dist/angular2-baidu-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ module.exports =
BaiduMap.prototype.ngOnInit = function () {
var offlineOpts = Object.assign({}, defaults_1.defaultOfflineOpts, this.offlineOpts);
this.offlineWords = offlineOpts.txt;
Loader_1.loader(this.ak, offlineOpts, this._draw.bind(this));
Loader_1.loader(this.ak, offlineOpts, this._draw.bind(this), this.protocol);
};
BaiduMap.prototype.ngOnChanges = function (changes) {
var baiduMap = window['baiduMap'];
Expand All @@ -98,6 +98,10 @@ module.exports =
core_1.Input(),
__metadata('design:type', String)
], BaiduMap.prototype, "ak", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', String)
], BaiduMap.prototype, "protocol", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', Object)
Expand Down Expand Up @@ -177,8 +181,9 @@ module.exports =

"use strict";
var MapStatus_1 = __webpack_require__(2);
exports.loader = function (ak, offlineOpts, callback) {
var MAP_URL = "//api.map.baidu.com/api?v=2.0&ak=" + ak + "&callback=baidumapinit&s=" + (location.protocol === 'https:' ? 1 : 0);
exports.loader = function (ak, offlineOpts, callback, protocol) {
var realProtocol = protocol || location.protocol;
var MAP_URL = realProtocol + "//api.map.baidu.com/api?v=2.0&ak=" + ak + "&callback=baidumapinit&s=" + (realProtocol === 'https:' ? 1 : 0);
var win = window;
var baiduMap = win['baiduMap'];
if (baiduMap && baiduMap.status === MapStatus_1.MapStatus.LOADING) {
Expand Down
Loading

0 comments on commit 8b6572d

Please sign in to comment.