@@ -559,10 +559,12 @@ var Tilemap = new Class({
559559 if ( index === null )
560560 {
561561 console . warn ( 'Invalid Tilemap Layer ID: ' + layerID ) ;
562+
562563 if ( typeof layerID === 'string' )
563564 {
564565 console . warn ( 'Valid tilelayer names:\n\t' + this . getTileLayerNames ( ) . join ( ',\n\t' ) ) ;
565566 }
567+
566568 return null ;
567569 }
568570
@@ -630,10 +632,12 @@ var Tilemap = new Class({
630632 if ( ! objectLayer )
631633 {
632634 console . warn ( 'Cannot create from object. Invalid objectgroup name given: ' + name ) ;
635+
633636 if ( typeof layerID === 'string' )
634637 {
635638 console . warn ( 'Valid objectgroup names:\n\t' + this . getObjectLayerNames ( ) . join ( ',\n\t' ) ) ;
636639 }
640+
637641 return null ;
638642 }
639643
@@ -1047,12 +1051,19 @@ var Tilemap = new Class({
10471051 * @method Phaser.Tilemaps.Tilemap#getImageLayerNames
10481052 * @since 3.21.0
10491053 *
1050- * @return {[ string] } Array of valid imagelayer names / IDs loaded into this Tilemap.
1054+ * @return {string[ ] } Array of valid imagelayer names / IDs loaded into this Tilemap.
10511055 */
10521056 getImageLayerNames : function ( )
10531057 {
1054- if ( ! this . images || ! Array . isArray ( this . images ) ) { return [ ] ; }
1055- return this . images . map ( function ( image ) { return image . name ; } ) ;
1058+ if ( ! this . images || ! Array . isArray ( this . images ) )
1059+ {
1060+ return [ ] ;
1061+ }
1062+
1063+ return this . images . map ( function ( image )
1064+ {
1065+ return image . name ;
1066+ } ) ;
10561067 } ,
10571068
10581069 /**
@@ -1124,12 +1135,19 @@ var Tilemap = new Class({
11241135 * @method Phaser.Tilemaps.Tilemap#getObjectLayerNames
11251136 * @since 3.21.0
11261137 *
1127- * @return {[ string] } Array of valid objectgroup names / IDs loaded into this Tilemap.
1138+ * @return {string[ ] } Array of valid objectgroup names / IDs loaded into this Tilemap.
11281139 */
11291140 getObjectLayerNames : function ( )
11301141 {
1131- if ( ! this . objects || ! Array . isArray ( this . objects ) ) { return [ ] ; }
1132- return this . objects . map ( function ( object ) { return object . name ; } ) ;
1142+ if ( ! this . objects || ! Array . isArray ( this . objects ) )
1143+ {
1144+ return [ ] ;
1145+ }
1146+
1147+ return this . objects . map ( function ( object )
1148+ {
1149+ return object . name ;
1150+ } ) ;
11331151 } ,
11341152
11351153 /**
@@ -1242,8 +1260,15 @@ var Tilemap = new Class({
12421260 */
12431261 getTileLayerNames : function ( )
12441262 {
1245- if ( ! this . layers || ! Array . isArray ( this . layers ) ) { return [ ] ; }
1246- return this . layers . map ( function ( layer ) { return layer . name ; } ) ;
1263+ if ( ! this . layers || ! Array . isArray ( this . layers ) )
1264+ {
1265+ return [ ] ;
1266+ }
1267+
1268+ return this . layers . map ( function ( layer )
1269+ {
1270+ return layer . name ;
1271+ } ) ;
12471272 } ,
12481273
12491274 /**
0 commit comments