77 var a = typeof exports === 'object' ? factory ( require ( "angular" ) ) : factory ( root [ "angular" ] ) ;
88 for ( var i in a ) ( typeof exports === 'object' ? exports : root ) [ i ] = a [ i ] ;
99 }
10- } ) ( this , function ( __WEBPACK_EXTERNAL_MODULE_2__ ) {
10+ } ) ( typeof self !== 'undefined' ? self : this , function ( __WEBPACK_EXTERNAL_MODULE_2__ ) {
1111return /******/ ( function ( modules ) { // webpackBootstrap
1212/******/ // The module cache
1313/******/ var installedModules = { } ;
@@ -723,15 +723,20 @@ function appendScriptTag(url) {
723723
724724 this . setKey = function ( val ) {
725725 ak = val ;
726- MAP_URL = '//api.map.baidu.com/api?v=2.0&ak=' + ak + '&callback=baidumapinit&s=' + ( location . protocol === 'https:' ? 1 : 0 ) ;
726+ MAP_URL = '//api.map.baidu.com/api?v=2.0&ak=' + ak + '&callback=baidumapinit' ;
727+
728+ if ( location . protocol . indexOf ( 'http' ) > - 1 ) {
729+ MAP_URL = MAP_URL + '&s=' + ( location . protocol === 'https:' ? 1 : 0 ) ;
730+ } else {
731+ MAP_URL = 'https:' + MAP_URL + '&s=1' ;
732+ }
727733 } ;
728734
729735 this . $get = function ( $rootScope ) {
730736 'ngInject' ;
731737
732738 return {
733739 load : function load ( ) {
734-
735740 Object ( __WEBPACK_IMPORTED_MODULE_0__helper_validate__ [ "d" /* nullCheck */ ] ) ( ak , 'ak should be set before use. Read: https://leftstick.github.io/BaiduMapForAngularJS/#!/quickstart' ) ;
736741
737742 var loadBaiduMapPromise = $rootScope . loadBaiduMapPromise ;
@@ -754,7 +759,6 @@ function appendScriptTag(url) {
754759 script . type = 'text/javascript' ;
755760 script . src = url ;
756761 script . onerror = function ( ) {
757-
758762 Array . prototype . slice . call ( document . querySelectorAll ( 'baidu-map .baidu-map-offline' ) ) . forEach ( function ( node ) {
759763 node . style . display = 'block' ;
760764 } ) ;
0 commit comments