This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const cameraValid = camera => | |
camera && camera.geometry && Array.isArray(camera.geometry.coordinates); | |
// Workaround for Mapbox issue | |
// https://github.com/mapbox/react-native-mapbox-gl/issues/1126 | |
export const enforceIntegerPadding = padding => | |
padding.map(value => parseInt(value, 10)); | |
export const isValidBounds = camera => | |
camera && |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function xmlToJson(xml) { | |
let obj = {}; | |
if (xml.nodeType === 1) { | |
if (xml.attributes.length > 0) { | |
obj['@attributes'] = {}; | |
for (let j = 0; j < xml.attributes.length; j++) { | |
const attribute = xml.attributes.item(j); | |
obj['@attributes'][attribute.nodeName] = attribute.nodeValue; | |
} |