
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
@softoat/react-native-geocoder
Advanced tools
Multi-platform geocoder library for React Native apps.
Multi-platform Geocoding library for React Native apps.
The project is originally forked from devfd/react-native-geocoder. Since 1.0 the project have been refactored and supports more features includes web support, maximum results limit, search boundary and request headers for Google Maps API.
Note: This is a pre-release version.
If you're looking for v0.x verison, please go to v0.x branch.
Please check the GitHub Release page for Version 1.0.0 Full Changelog and Migration Guide. [WORKING IN PROGRESS]
npm install @timwangdev/react-native-geocoder
or
yarn add @timwangdev/react-native-geocoder
react-native-cli
(requires react-native
0.60 or above)Please review autolinking docs for detials.
If "Autolinking" is not available for you, please try the following:
react-native link @timwangdev/react-native-geocoder
pod 'react-native-geocoder', :path => '../node_modules/@timwangdev/react-native-geocoder/react-native-geocoder.podspec'
to your Podfile.pod install
.Add Files to <...>
node_modules
➜ @timwangdev/react-native-geocoder
and add ios/RNGeocoder.xcodeproj
filelibGeocoder.a
to "Build Phases" -> "Link Binary With Libraries"android/setting.gradle
add:...
include ':react-native-geocoder', ':app'
project(':react-native-geocoder').projectDir = new File(rootProject.projectDir, '../node_modules/@timwangdev/react-native-geocoder/android')
android/app/build.gradle
...
dependencies {
...
implementation project(':react-native-geocoder')
}
import com.timwangdev.reactnativegeocoder.GeocoderPackage; // <--- Add this line
public class MainActivity extends ReactActivity {
...
@Override
protected List<ReactPackage> getPackages() {
...
packages.add(new GeocoderPackage()); // <--- Add this line
return packages;
}
...
}
import Geocoder from '@timwangdev/react-native-geocoder';
try {
...
const position = { lat: 1.2, lng: -3.4 };
await Geocoder.geocodePosition(position);
...
await Geocoder.geocodeAddress('Paris', {
locale: 'fr',
maxResults: 2,
});
...
} catch(err) {
...
}
Geocoder.geocodeAddress(address: string, options?: GeocoderOptions)
Returns Promise<GeocodingObject[]>
Supports regionIos
on iOS for preferred search boundary.
Supports bounds
on Android and Google Maps API.
Geocoder.geocodePosition(position: { lat: number, lng: number }, options?: GeocoderOptions)
Promise<GeocodingObject[]>
GeocoderOptions
{
// Your Google Maps API key, required if `fallbackToGoogle` or `forceGoogleOnIos` is `true`.
apiKey?: string;
// Preferred Locale for outputs, defaults to 'en'. (See Note 1)
locale?: string;
// Max number of addresses to return, defaults to 2. (See Note 2)
maxResults?: number;
// (Android and Google only) Set the bounds for address geocoding. (See Note 3)
bounds?: {
// Lower left corner
sw: { lat: number, lng: number },
// Upper right corner
ne: { lat: number, lng: number },
};
// (iOS native only) Set circular region for address geocoding. (See Note 3)
regionIos?: {
// Center of the circular region
center: { lat: number, lng: number },
// Radius of the circular region. Unit: km
radius: number,
};;
// Should use Google Maps API if native query fails, defaults to false.
fallbackToGoogle?: boolean;
// Should always use Google Maps API on iOS, defaults to false. (See Note 4)
forceGoogleOnIos?: boolean;
}
Platforms may have different implantations for locale preference. Here is Google Maps API supported language list.
Generally, only one entry will return, though the geocoder may return several results when address queries are ambiguous. Smaller numbers (1 to 5) for maxResults
are recommended.
On iOS the preferred search boundary for address geocoding only support "circular" region, while on Android and Google Maps API it using "rectangular" bounds. regionIos
will have no effect if forceGoogleOnIos
is true
.
Use forceGoogleOnIos
if you want consistent result on both iOS and Android platform, due to the limitation of iOS native implantation.
REMOVED requestHeaders
is useful together with Google API credentials restrictions by setting the Referer
header. See #20.
In order to avoid hitting rate limit or reducing API queries, you should cache the results in your program whenever possible.
GeocodingObject
{
position: { lat: number, lng: number };
// The full formatted address
formattedAddress: string;
// Example: Yosemite Park, Eiffel Tower
feature: string | null;
streetNumber: string | null;
streetName: string | null;
postalCode: string | null;
// City name
locality: string | null;
country: string;
countryCode: string;
adminArea: string | null;
subAdminArea: string | null;
subLocality: string | null;
}
MIT
FAQs
Multi-platform geocoder library for React Native apps.
We found that @softoat/react-native-geocoder demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.