Skip to content

Commit 5986d7d

Browse files
author
Thanh Phu
committed
Change maps to .cn
1 parent 8d485a6 commit 5986d7d

16 files changed

+977
-316
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Release Notes
5151

5252
# 1.4.0
5353

54-
* support lazy loading of maps js with directive, **map-lazy-load**, which does not require to `https://maps.google.com/maps/api/js`
54+
* support lazy loading of maps js with directive, **map-lazy-load**, which does not require to `https://maps.google.cn/maps/api/js`
5555
[Example](https://rawgit.com/allenhwkim/angularjs-google-maps/master/testapp/map-lazy-load.html)
5656

5757
# 1.3.0

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ Google Maps AngularJS Directive
44
[![Build Status](https://travis-ci.org/allenhwkim/angularjs-google-maps.png?branch=master)](https://travis-ci.org/allenhwkim/angularjs-google-maps)
55
-->
66

7-
[Demo](https://ngmap.github.io)
8-
[Documentation](https://rawgithub.amrom.workers.dev/allenhwkim/angularjs-google-maps/master/build/docs/index.html)
9-
[Road Trip By StreetView](https://rawgit.com/allenhwkim/angularjs-google-maps/master/testapp/street-view_road_trip.html)
7+
[Demo](https://ngmap.github.io)
8+
[Documentation](https://rawgithub.amrom.workers.dev/allenhwkim/angularjs-google-maps/master/build/docs/index.html)
9+
[Road Trip By StreetView](https://rawgit.com/allenhwkim/angularjs-google-maps/master/testapp/street-view_road_trip.html)
1010
[Maps Can Talk](https://rawgit.com/allenhwkim/angularjs-google-maps/master/testapp/custom-marker.html) |
11-
[Custom Marker](https://rawgit.com/allenhwkim/angularjs-google-maps/master/testapp/custom-marker-2.html)
11+
[Custom Marker](https://rawgit.com/allenhwkim/angularjs-google-maps/master/testapp/custom-marker-2.html)
1212

1313
If you like this, you also may like these:
1414
* [ng2-map](https://github.com/ng2-ui/map) Google Maps Wrapper for Angular 2+
@@ -18,10 +18,10 @@ Background
1818
-----------------
1919
There is already [one](https://github.com/nlaplante/angular-google-maps) for this. However, I found myself taking a totally different approach than the existing one, such as:
2020

21-
1. **Everything in tag and attributes.**
21+
1. **Everything in tag and attributes.**
2222
Thus, users don't even need knowledge of JavaScript.
23-
24-
2. **Expose all original Google Maps V3 API to the user.**
23+
24+
2. **Expose all original Google Maps V3 API to the user.**
2525
No hiding, no wrapping or whatsoever.
2626
By doing so, programmers don't need to learn how to use this module.
2727
You only need to know Google Maps V3 API.
@@ -37,8 +37,8 @@ For Bower users,
3737
1. Include `ng-map.min.js`:
3838
`<script src="/bower_components/ngmap/build/scripts/ng-map.min.js"></script>`
3939

40-
2. Include Google Maps:
41-
`<script src="http://maps.google.com/maps/api/js"></script>`
40+
2. Include Google Maps:
41+
`<script src="http://maps.google.cn/maps/api/js"></script>`
4242

4343
2. Name your AngularJS app ngMap, or add it as a dependency
4444

@@ -62,17 +62,17 @@ For Meteor users: https://atmospherejs.com/wormy/angularjs-google-maps
6262

6363
Lazy loading of Google Maps JavaScript
6464
---------------------------------------
65-
Simply wrap the map tag with `map-lazy-load="https://maps.google.com/maps/api/js"`.
65+
Simply wrap the map tag with `map-lazy-load="https://maps.google.cn/maps/api/js"`.
6666

67-
<div map-lazy-load="https://maps.google.com/maps/api/js">
67+
<div map-lazy-load="https://maps.google.cn/maps/api/js">
6868
<ng-map center="41,-87" zoom="3"></ng-map>
6969
</div>
7070

7171
If you need to pass in an API key to the javascript, you can set a scope
7272
variable in your controller (e.g. `$scope.googleMapsUrl="https://maps.googleapis.com/maps/api/js?key=YOUR_KEY_HERE";`).
7373
This can be set from a constant value in your app to standardise the API key to pass to google for multiple controllers.
7474

75-
<div map-lazy-load="https://maps.google.com/maps/api/js"
75+
<div map-lazy-load="https://maps.google.cn/maps/api/js"
7676
map-lazy-load-params="{{googleMapsUrl}}">
7777
<ng-map center="41,-87" zoom="3"></ng-map>
7878
</div>

build/docs/index.html

Lines changed: 313 additions & 115 deletions
Large diffs are not rendered by default.

build/docs/map-lazy-load.html

Lines changed: 287 additions & 21 deletions
Large diffs are not rendered by default.

build/docs/source/map-lazy-load.html

Lines changed: 291 additions & 94 deletions
Large diffs are not rendered by default.

build/scripts/ng-map.debug.js

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
* AngularJS Google Maps Ver. 1.18.4
33
*
44
* The MIT License (MIT)
5-
*
5+
*
66
* Copyright (c) 2014, 2015, 1016 Allen Kim
7-
*
7+
*
88
* Permission is hereby granted, free of charge, to any person obtaining a copy of
99
* this software and associated documentation files (the "Software"), to deal in
1010
* the Software without restriction, including without limitation the rights to
1111
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
1212
* the Software, and to permit persons to whom the Software is furnished to do so,
1313
* subject to the following conditions:
14-
*
14+
*
1515
* The above copyright notice and this permission notice shall be included in all
1616
* copies or substantial portions of the Software.
17-
*
17+
*
1818
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1919
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
2020
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
@@ -424,7 +424,7 @@ angular.module('ngMap', []);
424424
innerScope.$destroy();
425425
});
426426
});
427-
427+
428428

429429
/**
430430
* set events
@@ -775,7 +775,7 @@ angular.module('ngMap', []);
775775
request.travelMode = request.travelMode || 'DRIVING';
776776
var validKeys = [
777777
'origin', 'destination', 'travelMode', 'transitOptions', 'unitSystem',
778-
'durationInTraffic', 'waypoints', 'optimizeWaypoints',
778+
'durationInTraffic', 'waypoints', 'optimizeWaypoints',
779779
'provideRouteAlternatives', 'avoidHighways', 'avoidTolls', 'region'
780780
];
781781
if (request) {
@@ -1141,7 +1141,7 @@ angular.module('ngMap', []);
11411141
console.log('heatmap-layer options', layer, 'events', events);
11421142

11431143
mapController.addObject('heatmapLayers', layer);
1144-
1144+
11451145
//helper get nexted path
11461146
function parseScope( path, obj ) {
11471147
return path.split('.').reduce( function( prev, curr ) {
@@ -1384,7 +1384,7 @@ angular.module('ngMap', []);
13841384
*
13851385
* @attr {Url} url url of the kml layer
13861386
* @attr {KmlLayerOptions} KmlLayerOptions
1387-
* (https://developers.google.com/maps/documentation/javascript/reference#KmlLayerOptions)
1387+
* (https://developers.google.com/maps/documentation/javascript/reference#KmlLayerOptions)
13881388
* @attr {String} &lt;KmlLayerEvent> Any KmlLayer events,
13891389
* https://developers.google.com/maps/documentation/javascript/reference
13901390
* @example
@@ -1507,23 +1507,23 @@ angular.module('ngMap', []);
15071507
* @attr {String} map-lazy-load
15081508
* Maps api script source file location.
15091509
* Example:
1510-
* 'https://maps.google.com/maps/api/js'
1510+
* 'https://maps.google.cn/maps/api/js'
15111511
* @attr {String} map-lazy-load-params
15121512
* Maps api script source file location via angular scope variable.
15131513
* Also requires the map-lazy-load attribute to be present in the directive.
15141514
* Example: In your controller, set
1515-
* $scope.googleMapsURL = 'https://maps.google.com/maps/api/js?v=3.20&client=XXXXXenter-api-key-hereXXXX'
1515+
* $scope.googleMapsURL = 'https://maps.google.cn/maps/api/js?v=3.20&client=XXXXXenter-api-key-hereXXXX'
15161516
*
15171517
* @example
15181518
* Example:
15191519
*
1520-
* <div map-lazy-load="http://maps.google.com/maps/api/js">
1520+
* <div map-lazy-load="http://maps.google.cn/maps/api/js">
15211521
* <map center="Brampton" zoom="10">
15221522
* <marker position="Brampton"></marker>
15231523
* </map>
15241524
* </div>
15251525
*
1526-
* <div map-lazy-load="http://maps.google.com/maps/api/js"
1526+
* <div map-lazy-load="http://maps.google.cn/maps/api/js"
15271527
* map-lazy-load-params="{{googleMapsUrl}}">
15281528
* <map center="Brampton" zoom="10">
15291529
* <marker position="Brampton"></marker>
@@ -1605,7 +1605,7 @@ angular.module('ngMap', []);
16051605
/**
16061606
* @ngdoc directive
16071607
* @name map-type
1608-
* @param Attr2MapOptions {service}
1608+
* @param Attr2MapOptions {service}
16091609
* convert html attribute to Google map api options
16101610
* @description
16111611
* Requires: map directive
@@ -1819,7 +1819,7 @@ angular.module('ngMap', []);
18191819
if (NgMap.defaultOptions.marker) {
18201820
for (var key in NgMap.defaultOptions.marker) {
18211821
if (typeof options[key] == 'undefined') {
1822-
console.log('setting default marker options',
1822+
console.log('setting default marker options',
18231823
key, NgMap.defaultOptions.marker);
18241824
options[key] = NgMap.defaultOptions.marker[key];
18251825
}
@@ -2122,7 +2122,7 @@ angular.module('ngMap', []);
21222122
case "circle":
21232123
if (!(options.center instanceof google.maps.LatLng)) {
21242124
options.center = new google.maps.LatLng(0,0);
2125-
}
2125+
}
21262126
shape = new google.maps.Circle(options);
21272127
break;
21282128
case "polygon":
@@ -2533,10 +2533,10 @@ angular.module('ngMap', []);
25332533
}
25342534
return JSON.parse(jsonizeFilter(input));
25352535
};
2536-
2536+
25372537
var getLatLng = function(input) {
25382538
var output = input;
2539-
if (input[0].constructor == Array) {
2539+
if (input[0].constructor == Array) {
25402540
if ((input[0][0].constructor == Array && input[0][0].length == 2) || input[0][0].constructor == Object) {
25412541
var preoutput;
25422542
var outputArray = [];
@@ -3013,7 +3013,7 @@ angular.module('ngMap', []);
30133013
* @memberof NavigatorGeolocation
30143014
* @param {Object} geoLocationOptions the navigator geolocations options.
30153015
* i.e. { maximumAge: 3000, timeout: 5000, enableHighAccuracy: true }.
3016-
* If none specified, { timeout: 5000 }.
3016+
* If none specified, { timeout: 5000 }.
30173017
* If timeout not specified, timeout: 5000 added
30183018
* @param {function} success success callback function
30193019
* @param {function} failure failure callback function
@@ -3145,13 +3145,13 @@ angular.module('ngMap', []);
31453145
* @memberof NgMapPool
31463146
* @function returnMapInstance
31473147
* @param {Map} an instance of google.maps.Map
3148-
* @desc sets the flag inUse of the given map instance to false, so that it
3148+
* @desc sets the flag inUse of the given map instance to false, so that it
31493149
* can be reused later
31503150
*/
31513151
var returnMapInstance = function(map) {
31523152
map.inUse = false;
31533153
};
3154-
3154+
31553155
/**
31563156
* @memberof NgMapPool
31573157
* @function resetMapInstances
@@ -3163,7 +3163,7 @@ angular.module('ngMap', []);
31633163
}
31643164
mapInstances = [];
31653165
};
3166-
3166+
31673167
/**
31683168
* @memberof NgMapPool
31693169
* @function deleteMapInstance

build/scripts/ng-map.js

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@ factory(root.angular);
1111
* AngularJS Google Maps Ver. 1.18.4
1212
*
1313
* The MIT License (MIT)
14-
*
14+
*
1515
* Copyright (c) 2014, 2015, 1016 Allen Kim
16-
*
16+
*
1717
* Permission is hereby granted, free of charge, to any person obtaining a copy of
1818
* this software and associated documentation files (the "Software"), to deal in
1919
* the Software without restriction, including without limitation the rights to
2020
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
2121
* the Software, and to permit persons to whom the Software is furnished to do so,
2222
* subject to the following conditions:
23-
*
23+
*
2424
* The above copyright notice and this permission notice shall be included in all
2525
* copies or substantial portions of the Software.
26-
*
26+
*
2727
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2828
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
2929
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
@@ -433,7 +433,7 @@ angular.module('ngMap', []);
433433
innerScope.$destroy();
434434
});
435435
});
436-
436+
437437

438438
/**
439439
* set events
@@ -784,7 +784,7 @@ angular.module('ngMap', []);
784784
request.travelMode = request.travelMode || 'DRIVING';
785785
var validKeys = [
786786
'origin', 'destination', 'travelMode', 'transitOptions', 'unitSystem',
787-
'durationInTraffic', 'waypoints', 'optimizeWaypoints',
787+
'durationInTraffic', 'waypoints', 'optimizeWaypoints',
788788
'provideRouteAlternatives', 'avoidHighways', 'avoidTolls', 'region'
789789
];
790790
if (request) {
@@ -1150,7 +1150,7 @@ angular.module('ngMap', []);
11501150
void 0;
11511151

11521152
mapController.addObject('heatmapLayers', layer);
1153-
1153+
11541154
//helper get nexted path
11551155
function parseScope( path, obj ) {
11561156
return path.split('.').reduce( function( prev, curr ) {
@@ -1393,7 +1393,7 @@ angular.module('ngMap', []);
13931393
*
13941394
* @attr {Url} url url of the kml layer
13951395
* @attr {KmlLayerOptions} KmlLayerOptions
1396-
* (https://developers.google.com/maps/documentation/javascript/reference#KmlLayerOptions)
1396+
* (https://developers.google.com/maps/documentation/javascript/reference#KmlLayerOptions)
13971397
* @attr {String} &lt;KmlLayerEvent> Any KmlLayer events,
13981398
* https://developers.google.com/maps/documentation/javascript/reference
13991399
* @example
@@ -1516,23 +1516,23 @@ angular.module('ngMap', []);
15161516
* @attr {String} map-lazy-load
15171517
* Maps api script source file location.
15181518
* Example:
1519-
* 'https://maps.google.com/maps/api/js'
1519+
* 'https://maps.google.cn/maps/api/js'
15201520
* @attr {String} map-lazy-load-params
15211521
* Maps api script source file location via angular scope variable.
15221522
* Also requires the map-lazy-load attribute to be present in the directive.
15231523
* Example: In your controller, set
1524-
* $scope.googleMapsURL = 'https://maps.google.com/maps/api/js?v=3.20&client=XXXXXenter-api-key-hereXXXX'
1524+
* $scope.googleMapsURL = 'https://maps.google.cn/maps/api/js?v=3.20&client=XXXXXenter-api-key-hereXXXX'
15251525
*
15261526
* @example
15271527
* Example:
15281528
*
1529-
* <div map-lazy-load="http://maps.google.com/maps/api/js">
1529+
* <div map-lazy-load="http://maps.google.cn/maps/api/js">
15301530
* <map center="Brampton" zoom="10">
15311531
* <marker position="Brampton"></marker>
15321532
* </map>
15331533
* </div>
15341534
*
1535-
* <div map-lazy-load="http://maps.google.com/maps/api/js"
1535+
* <div map-lazy-load="http://maps.google.cn/maps/api/js"
15361536
* map-lazy-load-params="{{googleMapsUrl}}">
15371537
* <map center="Brampton" zoom="10">
15381538
* <marker position="Brampton"></marker>
@@ -1614,7 +1614,7 @@ angular.module('ngMap', []);
16141614
/**
16151615
* @ngdoc directive
16161616
* @name map-type
1617-
* @param Attr2MapOptions {service}
1617+
* @param Attr2MapOptions {service}
16181618
* convert html attribute to Google map api options
16191619
* @description
16201620
* Requires: map directive
@@ -2130,7 +2130,7 @@ angular.module('ngMap', []);
21302130
case "circle":
21312131
if (!(options.center instanceof google.maps.LatLng)) {
21322132
options.center = new google.maps.LatLng(0,0);
2133-
}
2133+
}
21342134
shape = new google.maps.Circle(options);
21352135
break;
21362136
case "polygon":
@@ -2540,10 +2540,10 @@ angular.module('ngMap', []);
25402540
}
25412541
return JSON.parse(jsonizeFilter(input));
25422542
};
2543-
2543+
25442544
var getLatLng = function(input) {
25452545
var output = input;
2546-
if (input[0].constructor == Array) {
2546+
if (input[0].constructor == Array) {
25472547
if ((input[0][0].constructor == Array && input[0][0].length == 2) || input[0][0].constructor == Object) {
25482548
var preoutput;
25492549
var outputArray = [];
@@ -3020,7 +3020,7 @@ angular.module('ngMap', []);
30203020
* @memberof NavigatorGeolocation
30213021
* @param {Object} geoLocationOptions the navigator geolocations options.
30223022
* i.e. { maximumAge: 3000, timeout: 5000, enableHighAccuracy: true }.
3023-
* If none specified, { timeout: 5000 }.
3023+
* If none specified, { timeout: 5000 }.
30243024
* If timeout not specified, timeout: 5000 added
30253025
* @param {function} success success callback function
30263026
* @param {function} failure failure callback function
@@ -3152,13 +3152,13 @@ angular.module('ngMap', []);
31523152
* @memberof NgMapPool
31533153
* @function returnMapInstance
31543154
* @param {Map} an instance of google.maps.Map
3155-
* @desc sets the flag inUse of the given map instance to false, so that it
3155+
* @desc sets the flag inUse of the given map instance to false, so that it
31563156
* can be reused later
31573157
*/
31583158
var returnMapInstance = function(map) {
31593159
map.inUse = false;
31603160
};
3161-
3161+
31623162
/**
31633163
* @memberof NgMapPool
31643164
* @function resetMapInstances
@@ -3170,7 +3170,7 @@ angular.module('ngMap', []);
31703170
}
31713171
mapInstances = [];
31723172
};
3173-
3173+
31743174
/**
31753175
* @memberof NgMapPool
31763176
* @function deleteMapInstance

0 commit comments

Comments
 (0)