npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@socialmedialabs/capacitor-native-geocoder

v1.0.2

Published

Native geocoding for Capacitor 7 (SDK 34-ready)

Readme

capacitor-native-geocoder

npm version npm downloads license platforms

Native geocoding (Apple CLGeocoder / Android android.location.Geocoder) for Capacitor 7.

  • ✅ Capacitor 7 compatible (@capacitor/core peer dependency)
  • ✅ Android API 34 ready (GeocodeListener on API 33+)
  • ✅ iOS Deployment Target ≥ 15, bundled MapKit + Contacts
  • ✅ Forward/Reverse Geocoding + Suggest (Autocomplete)

ℹ️ A forwardSuggestPlaces endpoint is planned for a future version. The current API is prepared for it but intentionally does not expose the method yet.

Installation

npm install @socialmedialabs/capacitor-native-geocoder

Then sync native platforms:

npx cap sync

Quick Start

import { NativeGeocoder } from '@socialmedialabs/capacitor-native-geocoder';

const { results } = await NativeGeocoder.forwardGeocode({
  address: 'Brandenburg Gate, Berlin',
  maxResults: 3,
});
console.log(results);

Android

  1. Ensure your android/capacitor.settings.gradle contains the correct include path. If you use the generator, Cap Sync handles this automatically:
    include ':capacitor-native-geocoder'
    project(':capacitor-native-geocoder').projectDir = new File('../node_modules/capacitor-native-geocoder/android')
  2. Make sure your app project sets both compileSdk and targetSdk to 34.

iOS

  1. Ensure your Xcode project uses iOS 15.0 or higher as deployment target.
  2. After each sync: cd ios && pod install.

TypeScript API

import { NativeGeocoder } from 'capacitor-native-geocoder';

const { results } = await NativeGeocoder.reverseGeocode({
  lat: 52.52,
  lon: 13.405,
  maxResults: 3,
  defaultLocale: 'de_DE',
});

Methods

| Method | Description | | ------ | ----------- | | reverseGeocode(options) | Coordinates → addresses. | | forwardGeocode(options) | Address → coordinates (multiple results possible). | | forwardSuggest(options) | Autocomplete suggestions; returns precise coordinates on iOS (where available) and Geocoder-based approximations on Android. |

Options

interface ReverseGeocodeOptions {
  lat: number;
  lon: number;
  useLocale?: boolean;
  defaultLocale?: string;
  maxResults?: number; // 1..5
}

interface ForwardGeocodeOptions {
  address: string;
  useLocale?: boolean;
  defaultLocale?: string;
  maxResults?: number; // 1..5
}

interface ForwardSuggestOptions {
  query?: string;
  address?: string; // fallback for existing integrations
  useLocale?: boolean;
  defaultLocale?: string;
  maxResults?: number; // 1..5
}

All methods return:

type GeocoderResponse = {
  results: NativeGeocoderResult[];
};

NativeGeocoderResult includes latitude/longitude, country, postal code, administrative levels, street metadata, optional points of interest, and a formatted display label.

Web Platform

reverseGeocode and forwardGeocode are not available on the Web and will throw UNIMPLEMENTED. forwardSuggest returns an empty array, allowing autocomplete-based UI to gracefully degrade.

Error Handling

  • Android returns an empty array on no result. Network or geocoder issues are logged and surfaced as empty lists.
  • iOS distinguishes between “no result” (empty list) and actual errors.
  • Both platforms clamp maxResults to between 1 and 5.
  • Locale: default is the device language. Set useLocale: false to enforce a neutral (English) lookup.

Development

npm run build
# runs clean → tsc → rollup

Before publishing:

  1. Update the version in package.json and CapacitorNativeGeocoder.podspec.
  2. Run npm run build, verify the output with npm pack.
  3. Update changelog and create git tag.

License

MIT © socialmedialabs.de