@@ -43,7 +43,7 @@ export const DEFAULT_WIDTH = '500px';
43
43
@Component ( {
44
44
selector : 'google-map' ,
45
45
changeDetection : ChangeDetectionStrategy . OnPush ,
46
- templateUrl : 'google- map.html ' ,
46
+ template : '<div class=" map-container"></div> ' ,
47
47
} )
48
48
export class GoogleMap implements OnChanges , OnInit , OnDestroy {
49
49
@Input ( ) height = DEFAULT_HEIGHT ;
@@ -65,19 +65,19 @@ export class GoogleMap implements OnChanges, OnInit, OnDestroy {
65
65
66
66
@Output ( ) boundsChanged = new EventEmitter < void > ( ) ;
67
67
@Output ( ) centerChanged = new EventEmitter < void > ( ) ;
68
- @Output ( ) click = new EventEmitter < google . maps . MouseEvent | google . maps . IconMouseEvent > ( ) ;
69
- @Output ( ) dblclick = new EventEmitter < google . maps . MouseEvent > ( ) ;
70
- @Output ( ) drag = new EventEmitter < void > ( ) ;
71
- @Output ( ) dragend = new EventEmitter < void > ( ) ;
72
- @Output ( ) dragstart = new EventEmitter < void > ( ) ;
68
+ @Output ( ) mapClick = new EventEmitter < google . maps . MouseEvent | google . maps . IconMouseEvent > ( ) ;
69
+ @Output ( ) mapDblclick = new EventEmitter < google . maps . MouseEvent > ( ) ;
70
+ @Output ( ) mapDrag = new EventEmitter < void > ( ) ;
71
+ @Output ( ) mapDragend = new EventEmitter < void > ( ) ;
72
+ @Output ( ) mapDragstart = new EventEmitter < void > ( ) ;
73
73
@Output ( ) headingChanged = new EventEmitter < void > ( ) ;
74
74
@Output ( ) idle = new EventEmitter < void > ( ) ;
75
75
@Output ( ) maptypeidChanged = new EventEmitter < void > ( ) ;
76
- @Output ( ) mousemove = new EventEmitter < google . maps . MouseEvent > ( ) ;
77
- @Output ( ) mouseout = new EventEmitter < google . maps . MouseEvent > ( ) ;
78
- @Output ( ) mouseover = new EventEmitter < google . maps . MouseEvent > ( ) ;
76
+ @Output ( ) mapMousemove = new EventEmitter < google . maps . MouseEvent > ( ) ;
77
+ @Output ( ) mapMouseout = new EventEmitter < google . maps . MouseEvent > ( ) ;
78
+ @Output ( ) mapMouseover = new EventEmitter < google . maps . MouseEvent > ( ) ;
79
79
@Output ( ) projectionChanged = new EventEmitter < void > ( ) ;
80
- @Output ( ) rightclick = new EventEmitter < google . maps . MouseEvent > ( ) ;
80
+ @Output ( ) mapRightclick = new EventEmitter < google . maps . MouseEvent > ( ) ;
81
81
@Output ( ) tilesloaded = new EventEmitter < void > ( ) ;
82
82
@Output ( ) tiltChanged = new EventEmitter < void > ( ) ;
83
83
@Output ( ) zoomChanged = new EventEmitter < void > ( ) ;
@@ -244,19 +244,25 @@ export class GoogleMap implements OnChanges, OnInit, OnDestroy {
244
244
245
245
private _initializeEventHandlers ( ) {
246
246
const eventHandlers = new Map < string , EventEmitter < void > > ( [
247
- [ 'bounds_changed' , this . boundsChanged ] , [ 'center_changed' , this . centerChanged ] ,
248
- [ 'drag' , this . drag ] , [ 'dragend' , this . dragend ] , [ 'dragstart' , this . dragstart ] ,
249
- [ 'heading_changed' , this . headingChanged ] , [ 'idle' , this . idle ] ,
250
- [ 'maptypeid_changed' , this . maptypeidChanged ] , [ 'projection_changed' , this . projectionChanged ] ,
251
- [ 'tilesloaded' , this . tilesloaded ] , [ 'tilt_changed' , this . tiltChanged ] ,
252
- [ 'zoomChanged' , this . zoomChanged ]
247
+ [ 'bounds_changed' , this . boundsChanged ] ,
248
+ [ 'center_changed' , this . centerChanged ] ,
249
+ [ 'drag' , this . mapDrag ] ,
250
+ [ 'dragend' , this . mapDragend ] ,
251
+ [ 'dragstart' , this . mapDragstart ] ,
252
+ [ 'heading_changed' , this . headingChanged ] ,
253
+ [ 'idle' , this . idle ] ,
254
+ [ 'maptypeid_changed' , this . maptypeidChanged ] ,
255
+ [ 'projection_changed' , this . projectionChanged ] ,
256
+ [ 'tilesloaded' , this . tilesloaded ] ,
257
+ [ 'tilt_changed' , this . tiltChanged ] ,
258
+ [ 'zoomChanged' , this . zoomChanged ] ,
253
259
] ) ;
254
260
const mouseEventHandlers = new Map < string , EventEmitter < google . maps . MouseEvent > > ( [
255
- [ 'dblclick' , this . dblclick ] ,
256
- [ 'mousemove' , this . mousemove ] ,
257
- [ 'mouseout' , this . mouseout ] ,
258
- [ 'mouseover' , this . mouseover ] ,
259
- [ 'rightclick' , this . rightclick ] ,
261
+ [ 'dblclick' , this . mapDblclick ] ,
262
+ [ 'mousemove' , this . mapMousemove ] ,
263
+ [ 'mouseout' , this . mapMouseout ] ,
264
+ [ 'mouseover' , this . mapMouseover ] ,
265
+ [ 'rightclick' , this . mapRightclick ] ,
260
266
] ) ;
261
267
eventHandlers . forEach ( ( eventHandler : EventEmitter < void > , name : string ) => {
262
268
if ( eventHandler . observers . length > 0 ) {
@@ -274,10 +280,10 @@ export class GoogleMap implements OnChanges, OnInit, OnDestroy {
274
280
} ) ) ;
275
281
}
276
282
} ) ;
277
- if ( this . click . observers . length > 0 ) {
283
+ if ( this . mapClick . observers . length > 0 ) {
278
284
this . _listeners . push ( this . _googleMap . addListener (
279
285
'click' , ( event : google . maps . MouseEvent | google . maps . IconMouseEvent ) => {
280
- this . click . emit ( event ) ;
286
+ this . mapClick . emit ( event ) ;
281
287
} ) ) ;
282
288
}
283
289
}
0 commit comments