providers/bing.js
function toGeoJSON(json, options = Options) {
  const collection = helpers.featureCollection([])
  json.resourceSets[0].resources.map(result => {
    // Point GeoJSON
    const point = parsePoint(result)
    const bbox = parseBBox(result)
    let confidence = confidenceScore(bbox)
    const properties = {
      confidence,
      authenticationResultCode: json.authenticationResultCode,
      brandLogoUri: json.brandLogoUri,
      copyright: json.copyright,
      entityType: result.entityType,
      matchCodes: result.matchCodes,
      name: result.name,
      statusCode: json.statusCode,
      statusDescription: json.statusDescription,
      traceId: json.traceId,
    }
    Object.keys(result.address).forEach(key => properties[key] = result.address[key])

    // Store Point to GeoJSON feature collection
    if (point) {
      point.bbox = bbox
      point.properties = properties
      collection.features.push(point)
    }
  })
  return collection
}
function toGeoJSON(json, options = Options) {
  const collection = helpers.featureCollection([])
  json.resourceSets[0].resources.map(result => {
    // Point GeoJSON
    const point = parsePoint(result)
    const bbox = parseBBox(result)
    let confidence = confidenceScore(bbox)
    const properties = {
      confidence,
      authenticationResultCode: json.authenticationResultCode,
      brandLogoUri: json.brandLogoUri,
      copyright: json.copyright,
      entityType: result.entityType,
      matchCodes: result.matchCodes,
      name: result.name,
      statusCode: json.statusCode,
      statusDescription: json.statusDescription,
      traceId: json.traceId,
    }
    Object.keys(result.address).forEach(key => properties[key] = result.address[key])

    // Store Point to GeoJSON feature collection
    if (point) {
      point.bbox = bbox
      point.properties = properties
      collection.features.push(point)
    }
  })
  return collection
}
function toGeoJSON ( json , options = Options ) { const collection = helpers . featureCollection ( [ ] ) json . resourceSets [ 0 ] . resources . map ( result => { // Point GeoJSON const point = parsePoint ( result ) const bbox = parseBBox ( result ) let confidence = confidenceScore ( bbox ) const properties = { confidence , authenticationResultCode : json . authenticationResultCode , brandLogoUri : json . brandLogoUri , copyright : json . copyright , entityType : result . entityType , matchCodes : result . matchCodes , name : result . name , statusCode : json . statusCode , statusDescription : json . statusDescription , traceId : json . traceId , } Object . keys ( result . address ) . forEach ( key => properties [ key ] = result . address [ key ] ) // Store Point to GeoJSON feature collection if ( point ) { point . bbox = bbox point . properties = properties collection . features . push ( point ) } } ) return collection }
Convert Bing results into GeoJSON
Convert Bing results into GeoJSON