GithubHelp home page GithubHelp logo

miguelramosfdz / react-native-geocoder Goto Github PK

View Code? Open in Web Editor NEW

This project forked from devfd/react-native-geocoder

0.0 1.0 0.0 132 KB

geocoding services for react native

License: MIT License

Objective-C 80.41% JavaScript 19.59%

react-native-geocoder's Introduction

react-native-geocoder

geocoding services for react native

Install

npm install --save react-native-geocoder

Then add RNGeocoder folder to your xcode project.

Usage

var RNGeocoder = require('react-native-geocoder');

// Reverse Geocoding
const NY = {
  latitude: 40.7809261,
  longitude: -73.9637594
};

RNGeocoder.reverseGeocodeLocation(NY, (err, data) => {
  if (err) {
    return;
  }

  console.log(data);
});

// Returned value
[
  {
    "postalCode":"10024",
    "subAdministrativeArea":"New York",
    "name":"Central Park",
    "locality":"New York",
    "subThoroughfare":"1000",
    "administrativeArea":"NY",
    "location":{
      "lat":40.7964708,
      "lng":-73.9545696
    },
    "country":"United States",
    "subLocality":"Manhattan",
    "thoroughfare":"5th Ave"
  }
]

// Address Geocoding
RNGeocoder.geocodeAddress('New York', (err, data) => {
  if (err) {
    return;
  }

  console.log(data);
});

// Returned value
[
  {
    "postalCode":null,
    "subAdministrativeArea":"New York",
    "name":"New York",
    "locality":"New York",
    "subThoroughfare":null,
    "administrativeArea":"NY",
    "location":{
      "lat":40.713054,
      "lng":-74.007228
    },
    "country":"United States",
    "subLocality":null,
    "thoroughfare":null
  }
]

With Promise

RNGeocoder.reverseGeocodeLocation(NY).then((data) => {
  ...  
});

RNGeocoder.geocodeAddress('New York').then((data) => {
  ...
});

react-native-geocoder's People

Contributors

devfd avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.