Skip to content
This repository was archived by the owner on Nov 30, 2018. It is now read-only.

Commit 8458a2a

Browse files
committed
fixed mergeing errors
2 parents 0cbb101 + a9b8dea commit 8458a2a

File tree

7 files changed

+57
-51
lines changed

7 files changed

+57
-51
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ old/
66
tmp/
77
*~
88
app/components
9-
/nbproject
9+
/nbproject
10+
.idea

Gruntfile.js

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@ module.exports = function(grunt) {
1111
grunt.loadNpmTasks('grunt-open');
1212
grunt.loadNpmTasks('grunt-mkdir');
1313
grunt.loadNpmTasks('grunt-contrib-coffee');
14-
14+
1515

1616
// Project configuration.
1717
grunt.initConfig({
18-
18+
1919
pkg: grunt.file.readJSON('package.json'),
20-
20+
2121
clean: {
2222
coffee: ['tmp/output_coffee.js'],
2323
dist: ['dist/*', 'tmp'],
2424
example: ['example/<%= pkg.name %>.js']
2525
},
26-
26+
2727
mkdir: {
2828
all: {
2929
options: {
@@ -36,7 +36,7 @@ module.exports = function(grunt) {
3636
coffee: {
3737
compile: {
3838
files: {
39-
'tmp/output_coffee.js':
39+
'tmp/output_coffee.js':
4040
['src/coffee/*.coffee',
4141
'src/coffee/oo/ng-gmap-module.coffee',
4242
'src/coffee/oo/base-object.coffee',
@@ -49,21 +49,21 @@ module.exports = function(grunt) {
4949
}
5050
}
5151
},
52-
52+
5353
concat: {
5454
options: {
5555
separator: ';'
5656
},
5757
dist: {
58-
src: ['src/js/module.js',
58+
src: ['src/js/module.js',
5959
'tmp/output_coffee.js',
6060
'src/js/utils/markerclusterer-r438.js',
6161
'src/js/utils/LatLngArraySync.js',
6262
'src/js/utils/MapEvents.js',
6363
'src/js/controllers/polyline-display.js',
64-
'src/js/directives/map.js',
65-
'src/js/directives/marker.js',
66-
'src/js/directives/markers.js',
64+
'src/js/directives/map.js',
65+
'src/js/directives/marker.js',
66+
'src/js/directives/markers.js',
6767
'src/js/directives/polygon.js',
6868
'src/js/directives/polyline.js',
6969
'src/js/directives/window.js',
@@ -78,9 +78,9 @@ module.exports = function(grunt) {
7878
'src/js/utils/LatLngArraySync.js',
7979
'src/js/utils/MapEvents.js',
8080
'src/js/controllers/polyline-display.js',
81-
'src/js/directives/map.js',
82-
'src/js/directives/marker.js',
83-
'src/js/directives/markers.js',
81+
'src/js/directives/map.js',
82+
'src/js/directives/marker.js',
83+
'src/js/directives/markers.js',
8484
'src/js/directives/polygon.js',
8585
'src/js/directives/polyline.js',
8686
'src/js/directives/window.js',
@@ -89,7 +89,7 @@ module.exports = function(grunt) {
8989
dest: 'example/<%= pkg.name %>.js'
9090
}
9191
},
92-
92+
9393
copy: {
9494
dist: {
9595
files: [{
@@ -98,7 +98,7 @@ module.exports = function(grunt) {
9898
}]
9999
}
100100
},
101-
101+
102102
uglify: {
103103
options: {
104104
banner: '/*! <%= pkg.name %> <%= pkg.version %> <%= grunt.template.today("yyyy-mm-dd") %>\n * <%= pkg.description %>\n * <%= pkg.repository.type %>: <%= pkg.repository.url %>\n */\n',
@@ -110,30 +110,30 @@ module.exports = function(grunt) {
110110
dest: 'dist/<%= pkg.name %>.min.js'
111111
}
112112
},
113-
113+
114114
jshint: {
115115
all: ['Gruntfile.js', 'src/js/**/*.js', 'test/js/**/*.js'],
116116
options: {ignores: ['src/js/utils/markerclusterer-r438.js']}
117117
},
118-
118+
119119
test: {
120-
120+
121121
},
122-
122+
123123
watch: {
124124
all: {
125125
options: { livereload: true },
126126
files: ['src/js/**/*.js','src/coffee/**/*.coffee','src/coffee/*.coffee'],
127127
tasks: ['clean:example','coffee','concat:example'],
128128
},
129129
},
130-
130+
131131
open: {
132132
example: {
133133
path: 'http://localhost:3000/example.html'
134134
}
135135
},
136-
136+
137137
connect: {
138138
server: {
139139
options: {
@@ -151,14 +151,14 @@ module.exports = function(grunt) {
151151

152152
// Default task: build a release in dist/
153153
grunt.registerTask('default', ['clean:dist',
154-
'test',
155-
'jshint',
156-
'mkdir',
154+
'test',
155+
'jshint',
156+
'mkdir',
157157
'coffee',
158-
'concat:dist',
158+
'concat:dist',
159159
'copy:dist',
160160
'uglify']);
161-
161+
162162
// Run the example page by creating a local copy of angular-google-maps.js
163163
// and running a webserver on port 3000 with livereload. Web page is opened
164164
// automatically in the default browser.

dist/angular-google-maps.js

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -358,9 +358,7 @@
358358
visible: (coords.latitude != null) && (coords.longitude != null)
359359
});
360360
if (map != null) {
361-
opts.map = {
362-
map: map.getMap()
363-
};
361+
opts.map = map;
364362
}
365363
return opts;
366364
},
@@ -882,7 +880,7 @@
882880
_this = this;
883881
MarkerParentModel.__super__.constructor.call(this, scope, element, attrs, mapCtrl, $timeout);
884882
self = this;
885-
opts = this.createMarkerOptions(scope.coords, scope.icon, scope.options, mapCtrl);
883+
opts = this.createMarkerOptions(scope.coords, scope.icon, scope.options, mapCtrl.getMap());
886884
this.gMarker = new google.maps.Marker(opts);
887885
element.data('instance', this.gMarker);
888886
this.scope = scope;
@@ -926,7 +924,7 @@
926924
if ((scope.coords != null) && (scope.icon != null) && scope.options) {
927925
this.gMarker.setMap(null);
928926
delete this.gMarker;
929-
return this.gMarker = new google.maps.Marker(this.createMarkerOptions(scope.coords, scope.icon, scope.options, this.mapCtrl));
927+
return this.gMarker = new google.maps.Marker(this.createMarkerOptions(scope.coords, scope.icon, scope.options, this.mapCtrl.getMap()));
930928
}
931929
break;
932930
}
@@ -3347,7 +3345,7 @@ angular.module('google-maps')
33473345
.directive('googleMap', ['$log', '$timeout', function ($log, $timeout) {
33483346

33493347
"use strict";
3350-
3348+
33513349
directives.api.utils.Logger.logger = $log;
33523350

33533351
var DEFAULTS = {
@@ -3406,7 +3404,8 @@ angular.module('google-maps')
34063404
markers: '=markers', // optional
34073405
refresh: '&refresh', // optional
34083406
windows: '=windows', // optional
3409-
events: '=events', // optional
3407+
options: '=options', // optional
3408+
events: '=events', // optional
34103409
bounds: '=bounds'
34113410
},
34123411

@@ -3451,7 +3450,7 @@ angular.module('google-maps')
34513450
// Parse options
34523451
var opts = {options: {}};
34533452
if (attrs.options) {
3454-
opts.options = angular.fromJson(attrs.options);
3453+
opts.options = scope.options;
34553454
}
34563455

34573456
if (attrs.type) {
@@ -3518,7 +3517,7 @@ angular.module('google-maps')
35183517
google.maps.event.addListener(_m, 'center_changed', function () {
35193518
var c = _m.center;
35203519

3521-
if(settingCenterFromScope)
3520+
if(settingCenterFromScope)
35223521
return; //if the scope notified this change then there is no reason to update scope otherwise infinite loop
35233522
$timeout(function () {
35243523
scope.$apply(function (s) {
@@ -3621,7 +3620,7 @@ angular.module('google-maps')
36213620

36223621
//_m.draw();
36233622
});
3624-
3623+
36253624
scope.$watch('bounds', function (newValue, oldValue) {
36263625
if (newValue === oldValue) {
36273626
return;

dist/angular-google-maps.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/example-controller.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ function ExampleController ($scope, $timeout, $log) {
4040
latitude: 45,
4141
longitude: -73
4242
},
43+
options: {
44+
streetViewControl: false,
45+
panControl: false
46+
},
4347
zoom: 3,
4448
dragging: false,
4549
bounds: {},
@@ -189,7 +193,7 @@ function ExampleController ($scope, $timeout, $log) {
189193
});
190194

191195
_.each($scope.map.markers,function(marker){
192-
marker.closeClick = function(){
196+
marker.closeClick = function(){
193197
marker.showWindow = false;
194198
$scope.$apply();
195199
};
@@ -199,7 +203,7 @@ function ExampleController ($scope, $timeout, $log) {
199203
});
200204

201205
_.each($scope.map.markers2,function(marker){
202-
marker.closeClick = function(){
206+
marker.closeClick = function(){
203207
marker.showWindow = false;
204208
$scope.$apply();
205209
};
@@ -244,7 +248,7 @@ function ExampleController ($scope, $timeout, $log) {
244248
}
245249
];
246250
_.each(dynamicMarkers,function(marker){
247-
marker.closeClick = function(){
251+
marker.closeClick = function(){
248252
marker.showWindow = false;
249253
$scope.$apply();
250254
};

example/example.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
<!--[if IE]>
99
<script>
1010
window.html5 = {
11-
'elements': 'marker window windows markers trafficlayer polyline'
11+
'elements': 'marker window windows markers trafficlayer polyline'
1212
};
1313
</script>
14-
14+
1515
<script src="es5-shim.js"></script>
1616
<script src="event-shim.js"></script>
1717
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
1818
<![endif]-->
19-
19+
2020
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet">
2121
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,800,600,300,700' rel='stylesheet' type='text/css'>
2222
<style>
@@ -74,7 +74,8 @@ <h1>angular-google-maps example</h1>
7474
draggable="true"
7575
dragging="map.dragging"
7676
bounds="map.bounds"
77-
events="map.events">
77+
events="map.events"
78+
options="map.options">
7879
<trafficlayer show="map.showTraffic" />
7980

8081
<markers models="map.randomMarkers" coords="'self'" icon="'icon'" click="'onClicked'" doCluster="true">

src/js/directives/map.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ angular.module('google-maps')
3131
.directive('googleMap', ['$log', '$timeout', function ($log, $timeout) {
3232

3333
"use strict";
34-
34+
3535
directives.api.utils.Logger.logger = $log;
3636

3737
var DEFAULTS = {
@@ -90,7 +90,8 @@ angular.module('google-maps')
9090
markers: '=markers', // optional
9191
refresh: '&refresh', // optional
9292
windows: '=windows', // optional
93-
events: '=events', // optional
93+
options: '=options', // optional
94+
events: '=events', // optional
9495
bounds: '=bounds'
9596
},
9697

@@ -135,7 +136,7 @@ angular.module('google-maps')
135136
// Parse options
136137
var opts = {options: {}};
137138
if (attrs.options) {
138-
opts.options = angular.fromJson(attrs.options);
139+
opts.options = scope.options;
139140
}
140141

141142
if (attrs.type) {
@@ -202,7 +203,7 @@ angular.module('google-maps')
202203
google.maps.event.addListener(_m, 'center_changed', function () {
203204
var c = _m.center;
204205

205-
if(settingCenterFromScope)
206+
if(settingCenterFromScope)
206207
return; //if the scope notified this change then there is no reason to update scope otherwise infinite loop
207208
$timeout(function () {
208209
scope.$apply(function (s) {
@@ -305,7 +306,7 @@ angular.module('google-maps')
305306

306307
//_m.draw();
307308
});
308-
309+
309310
scope.$watch('bounds', function (newValue, oldValue) {
310311
if (newValue === oldValue) {
311312
return;

0 commit comments

Comments
 (0)