(containerIn, containerOut, coerce)
| 17 | }; |
| 18 | |
| 19 | function handleDefaults(containerIn, containerOut, coerce) { |
| 20 | coerce('style'); |
| 21 | coerce('center.lon'); |
| 22 | coerce('center.lat'); |
| 23 | coerce('zoom'); |
| 24 | coerce('bearing'); |
| 25 | coerce('pitch'); |
| 26 | |
| 27 | var west = coerce('bounds.west'); |
| 28 | var east = coerce('bounds.east'); |
| 29 | var south = coerce('bounds.south'); |
| 30 | var north = coerce('bounds.north'); |
| 31 | if( |
| 32 | west === undefined || |
| 33 | east === undefined || |
| 34 | south === undefined || |
| 35 | north === undefined |
| 36 | ) { |
| 37 | delete containerOut.bounds; |
| 38 | } |
| 39 | |
| 40 | handleArrayContainerDefaults(containerIn, containerOut, { |
| 41 | name: 'layers', |
| 42 | handleItemDefaults: handleLayerDefaults |
| 43 | }); |
| 44 | |
| 45 | // copy ref to input container to update 'center' and 'zoom' on map move |
| 46 | containerOut._input = containerIn; |
| 47 | } |
| 48 | |
| 49 | function handleLayerDefaults(layerIn, layerOut) { |
| 50 | function coerce(attr, dflt) { |
no test coverage detected
searching dependent graphs…