@@ -1409,6 +1409,8 @@ Nicholas McCready - https://twitter.com/nmccready
1409
1409
ClustererMarkerManager = ( function ( _super ) {
1410
1410
__extends ( ClustererMarkerManager , _super ) ;
1411
1411
1412
+ ClustererMarkerManager . type = 'ClustererMarkerManager' ;
1413
+
1412
1414
function ClustererMarkerManager ( gMap , opt_markers , opt_options , opt_events ) {
1413
1415
var self ;
1414
1416
this . opt_events = opt_events ;
@@ -1423,6 +1425,7 @@ Nicholas McCready - https://twitter.com/nmccready
1423
1425
this . addMany = __bind ( this . addMany , this ) ;
1424
1426
this . add = __bind ( this . add , this ) ;
1425
1427
ClustererMarkerManager . __super__ . constructor . call ( this ) ;
1428
+ this . type = ClustererMarkerManager . type ;
1426
1429
self = this ;
1427
1430
this . opt_options = opt_options ;
1428
1431
if ( ( opt_options != null ) && opt_markers === void 0 ) {
@@ -1568,6 +1571,8 @@ Nicholas McCready - https://twitter.com/nmccready
1568
1571
1569
1572
MarkerManager . include ( FitHelper ) ;
1570
1573
1574
+ MarkerManager . type = 'MarkerManager' ;
1575
+
1571
1576
function MarkerManager ( gMap , opt_markers , opt_options ) {
1572
1577
this . getGMarkers = __bind ( this . getGMarkers , this ) ;
1573
1578
this . fit = __bind ( this . fit , this ) ;
@@ -1579,6 +1584,7 @@ Nicholas McCready - https://twitter.com/nmccready
1579
1584
this . addMany = __bind ( this . addMany , this ) ;
1580
1585
this . add = __bind ( this . add , this ) ;
1581
1586
MarkerManager . __super__ . constructor . call ( this ) ;
1587
+ this . type = MarkerManager . type ;
1582
1588
this . gMap = gMap ;
1583
1589
this . gMarkers = new PropMap ( ) ;
1584
1590
this . $log = Logger ;
@@ -2273,7 +2279,7 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi
2273
2279
__extends = function ( child , parent ) { for ( var key in parent ) { if ( __hasProp . call ( parent , key ) ) child [ key ] = parent [ key ] ; } function ctor ( ) { this . constructor = child ; } ctor . prototype = parent . prototype ; child . prototype = new ctor ( ) ; child . __super__ = parent . prototype ; return child ; } ;
2274
2280
2275
2281
angular . module ( "google-maps.directives.api.models.child" . ns ( ) ) . factory ( "MarkerChildModel" . ns ( ) , [
2276
- "ModelKey" . ns ( ) , "GmapUtil" . ns ( ) , "Logger" . ns ( ) , "EventsHelper" . ns ( ) , "PropertyAction" . ns ( ) , "MarkerOptions" . ns ( ) , "IMarker" . ns ( ) , function ( ModelKey , GmapUtil , $log , EventsHelper , PropertyAction , MarkerOptions , IMarker ) {
2282
+ "ModelKey" . ns ( ) , "GmapUtil" . ns ( ) , "Logger" . ns ( ) , "EventsHelper" . ns ( ) , "PropertyAction" . ns ( ) , "MarkerOptions" . ns ( ) , "IMarker" . ns ( ) , "MarkerManager" . ns ( ) , function ( ModelKey , GmapUtil , $log , EventsHelper , PropertyAction , MarkerOptions , IMarker , MarkerManager ) {
2277
2283
var MarkerChildModel , keys ;
2278
2284
keys = [ 'coords' , 'icon' , 'options' , 'fit' ] ;
2279
2285
MarkerChildModel = ( function ( _super ) {
@@ -2526,13 +2532,13 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi
2526
2532
this . gMarker . key = this . id ;
2527
2533
}
2528
2534
this . gMarkerManager . add ( this . gMarker ) ;
2529
- if ( this . gMarker && this . gMarker . getMap ( ) ) {
2535
+ if ( this . gMarker && ( this . gMarker . getMap ( ) || this . gMarkerManager . type !== MarkerManager . type ) ) {
2530
2536
this . deferred . resolve ( this . gMarker ) ;
2531
2537
} else {
2532
2538
if ( ! this . gMarker ) {
2533
2539
this . deferred . reject ( "gMarker is null" ) ;
2534
2540
}
2535
- if ( ! this . gMarker . getMap ( ) ) {
2541
+ if ( ! ( this . gMarker . getMap ( ) && this . gMarkerManager . type === MarkerManager . type ) ) {
2536
2542
this . deferred . reject ( "gMarker has no map" ) ;
2537
2543
}
2538
2544
}
0 commit comments