@@ -1363,6 +1363,8 @@ ngMap.directive('mapType', ['Attr2Options', '$window', function(Attr2Options, $w
1363
1363
* The center of map incase geolocation failed. i.e. [0,0]
1364
1364
* @param {Boolean } zoom-to-include-markers
1365
1365
* When true, map boundary will be changed automatially to include all markers when initialized
1366
+ * @param {Boolean } default-style
1367
+ * When false, the default styling, `display:block;height:300px`, will be ignored.
1366
1368
* @param {String } init-event The name of event to initialize this map.
1367
1369
* If this option is given, the map won't be initialized until the event is received.
1368
1370
* To invoke the event, use $scope.$emit or $scope.$broacast.
@@ -1426,11 +1428,13 @@ ngMap.directive('mapType', ['Attr2Options', '$window', function(Attr2Options, $w
1426
1428
/**
1427
1429
* if style is not given to the map element, set display and height
1428
1430
*/
1429
- if ( getStyle ( element [ 0 ] , 'display' ) != "block" ) {
1430
- element . css ( 'display' , 'block' ) ;
1431
- }
1432
- if ( getStyle ( element [ 0 ] , 'height' ) . match ( / ^ ( 0 | a u t o ) / ) ) {
1433
- element . css ( 'height' , '300px' ) ;
1431
+ if ( attrs . defaultStyle !== 'false' ) {
1432
+ if ( getStyle ( element [ 0 ] , 'display' ) != "block" ) {
1433
+ element . css ( 'display' , 'block' ) ;
1434
+ }
1435
+ if ( getStyle ( element [ 0 ] , 'height' ) . match ( / ^ ( 0 | a u t o ) / ) ) {
1436
+ element . css ( 'height' , '300px' ) ;
1437
+ }
1434
1438
}
1435
1439
1436
1440
/**
0 commit comments