@@ -94,14 +94,14 @@ export default abstract class<
9494 Polyline ,
9595> extends Controller < HTMLElement > {
9696 static values = {
97- providerOptions : { type : Object } ,
98- center : { type : Object , default : null } ,
99- zoom : { type : Number , default : null } ,
100- fitBoundsToMarkers : { type : Boolean } ,
101- markers : { type : Array } ,
102- polygons : { type : Array } ,
103- polylines : { type : Array } ,
104- options : { type : Object } ,
97+ providerOptions : Object ,
98+ center : Object ,
99+ zoom : Number ,
100+ fitBoundsToMarkers : Boolean ,
101+ markers : Array ,
102+ polygons : Array ,
103+ polylines : Array ,
104+ options : Object ,
105105 } ;
106106
107107 declare centerValue : Point | null ;
@@ -112,6 +112,14 @@ export default abstract class<
112112 declare polylinesValue: Array < PolylineDefinition < PolylineOptions , InfoWindowOptions > > ;
113113 declare optionsValue: MapOptions ;
114114
115+ declare hasCenterValue: boolean ;
116+ declare hasZoomValue: boolean ;
117+ declare hasFitBoundsToMarkersValue: boolean ;
118+ declare hasMarkersValue: boolean ;
119+ declare hasPolygonsValue: boolean ;
120+ declare hasPolylinesValue: boolean ;
121+ declare hasOptionsValue: boolean ;
122+
115123 protected map : Map ;
116124 protected markers = new Map < Identifier , Marker > ( ) ;
117125 protected polygons = new Map < Identifier , Polygon > ( ) ;
@@ -140,7 +148,11 @@ export default abstract class<
140148 this . createPolygon = this . createDrawingFactory ( 'polygon' , this . polygons , this . doCreatePolygon . bind ( this ) ) ;
141149 this . createPolyline = this . createDrawingFactory ( 'polyline' , this . polylines , this . doCreatePolyline . bind ( this ) ) ;
142150
143- this . map = this . doCreateMap ( { center : this . centerValue , zoom : this . zoomValue , options } ) ;
151+ this . map = this . doCreateMap ( {
152+ center : this . hasCenterValue ? this . centerValue : null ,
153+ zoom : this . hasZoomValue ? this . zoomValue : null ,
154+ options,
155+ } ) ;
144156 this . markersValue . forEach ( ( definition ) => this . createMarker ( { definition } ) ) ;
145157 this . polygonsValue . forEach ( ( definition ) => this . createPolygon ( { definition } ) ) ;
146158 this . polylinesValue . forEach ( ( definition ) => this . createPolyline ( { definition } ) ) ;
0 commit comments