|
190 | 190 | controller.getMap().then(function(map) { |
191 | 191 | transclude(scope, function(transcludedContent) { |
192 | 192 | var popupContentElement; |
193 | | - if(transcludedContent) { |
| 193 | + |
| 194 | + if(transcludedContent !== null && transcludedContent.length > 0) { |
194 | 195 | popupContentElement = document.createElement('span'); |
195 | 196 | for(var i = 0; i < transcludedContent.length; i++) { |
196 | 197 | popupContentElement.appendChild(transcludedContent[i]); |
|
276 | 277 | }); |
277 | 278 | })(); |
278 | 279 |
|
279 | | - |
280 | 280 | (function() { |
281 | 281 | 'use strict'; |
282 | 282 |
|
|
311 | 311 | scope.map.scrollWheelZoom.disable(); |
312 | 312 | } |
313 | 313 |
|
314 | | - var mapWidth = attrs.width || 500; |
315 | | - var mapHeight = attrs.height || 500; |
| 314 | + if (attrs.autoSize === undefined ) { |
| 315 | + var mapWidth = attrs.width || 500; |
| 316 | + var mapHeight = attrs.height || 500; |
316 | 317 |
|
317 | | - if ( isNaN(mapWidth) ) { |
318 | | - element.css('width', mapWidth); |
319 | | - } else { |
320 | | - element.css('width', mapWidth + 'px'); |
321 | | - } |
| 318 | + if ( isNaN(mapWidth) ) { |
| 319 | + element.css('width', mapWidth); |
| 320 | + } else { |
| 321 | + element.css('width', mapWidth + 'px'); |
| 322 | + } |
322 | 323 |
|
323 | | - if ( isNaN(mapHeight) ) { |
324 | | - element.css('height', mapHeight); |
325 | | - } else { |
326 | | - element.css('height', mapHeight + 'px'); |
| 324 | + if ( isNaN(mapHeight) ) { |
| 325 | + element.css('height', mapHeight); |
| 326 | + } else { |
| 327 | + element.css('height', mapHeight + 'px'); |
| 328 | + } |
327 | 329 | } |
328 | 330 |
|
329 | 331 | scope.zoom = attrs.zoom || 12; |
|
432 | 434 | controller.getMap().then(function(map) { |
433 | 435 | transclude(scope, function(transcludedContent) { |
434 | 436 | var popupContentElement; |
435 | | - if(transcludedContent != null && transcludedContent.length > 0) { |
| 437 | + if(transcludedContent !== null && transcludedContent.length > 0) { |
436 | 438 | popupContentElement = document.createElement('span'); |
437 | 439 | for(var i = 0; i < transcludedContent.length; i++) { |
438 | 440 | popupContentElement.appendChild(transcludedContent[i]); |
|
516 | 518 | } |
517 | 519 | }); |
518 | 520 | })(); |
519 | | - |
|
0 commit comments