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

expo-apple-mapkit

v0.1.1

Published

apple mapkit

Readme

expo-apple-mapkit

Expo module for integrating Apple MapKit functionality into React Native applications. This library provides access to location search, route calculation, reverse geocoding, and map view capabilities using Apple's MapKit framework.

Features

  • 🔍 Location Search: Search for places, addresses, and points of interest using natural language queries
  • 🗺️ Route Calculation: Get driving, walking, transit, or any route directions between two coordinates
  • 📍 Reverse Geocoding: Convert coordinates (latitude/longitude) to human-readable addresses
  • 🗺️ Map View: Display Apple MapKit maps in your React Native application
  • TypeScript Support: Full TypeScript definitions included
  • 🍎 iOS Native: Built on top of Apple's native MapKit framework

API Documentation

Installation in managed Expo projects

For managed Expo projects, please follow the installation instructions in the API documentation for the latest stable release. If you follow the link and there is no documentation available then this library is not yet usable within managed projects — it is likely to be included in an upcoming Expo SDK release.

Installation in bare React Native projects

For bare React Native projects, you must ensure that you have installed and configured the expo package before continuing.

Add the package to your npm dependencies

npm install expo-apple-mapkit

Configure for Android

Configure for iOS

Run npx pod-install after installing the npm package.

Usage

Location Search

Search for places, addresses, and points of interest:

import { searchLocation, LocationSearchOptions } from 'expo-apple-mapkit';

// Basic search
const results = await searchLocation('coffee shops near me');

// Search with region and options
const options: LocationSearchOptions = {
  region: {
    latitude: 37.7749,
    longitude: -122.4194,
    latitudeDelta: 0.1,
    longitudeDelta: 0.1,
  },
  resultLimit: 10,
  includePointsOfInterest: true,
  includeQueries: true,
};

const results = await searchLocation('restaurants', options);
console.log(results);

Route Calculation

Get directions between two coordinates:

import { getRoute, Coordinate, RouteOptions } from 'expo-apple-mapkit';

const origin: Coordinate = { latitude: 37.7749, longitude: -122.4194 };
const destination: Coordinate = { latitude: 37.7849, longitude: -122.4094 };

// Get driving route
const routes = await getRoute(origin, destination, {
  transportType: 'automobile',
  requestsAlternateRoutes: true,
});

// Get walking route
const walkingRoutes = await getRoute(origin, destination, {
  transportType: 'walking',
});

console.log(routes[0].distance); // Distance in meters
console.log(routes[0].expectedTravelTime); // Time in seconds
console.log(routes[0].steps); // Array of route steps

Reverse Geocoding

Convert coordinates to addresses:

import { reverseGeocode, Coordinate } from 'expo-apple-mapkit';

const coordinate: Coordinate = { latitude: 37.7749, longitude: -122.4194 };
const result = await reverseGeocode(coordinate);

if (result) {
  console.log(result.formattedAddress);
  console.log(result.placemark.locality); // City
  console.log(result.placemark.administrativeArea); // State/Province
  console.log(result.placemark.country); // Country
}

API Reference

Functions

searchLocation(query: string, options?: LocationSearchOptions | LocationSearchRegion): Promise<LocationSearchResult[]>

Searches for locations based on a query string.

Parameters:

  • query (string): The search query (e.g., "coffee shops", "123 Main St")
  • options (optional): Search options or region object for backward compatibility

Returns: Promise resolving to an array of search results

Example:

const results = await searchLocation('Starbucks near San Francisco');

getRoute(origin: Coordinate, destination: Coordinate, options?: RouteOptions): Promise<Route[]>

Calculates routes between two coordinates.

Parameters:

  • origin (Coordinate): Starting point coordinates
  • destination (Coordinate): Destination coordinates
  • options (optional): Route calculation options

Returns: Promise resolving to an array of possible routes

Example:

const routes = await getRoute(
  { latitude: 37.7749, longitude: -122.4194 },
  { latitude: 37.7849, longitude: -122.4094 },
  { transportType: 'automobile' }
);

reverseGeocode(coordinate: Coordinate): Promise<ReverseGeocodeResult | null>

Converts coordinates to a human-readable address.

Parameters:

  • coordinate (Coordinate): Latitude and longitude to geocode

Returns: Promise resolving to geocoding result or null if not found

Example:

const result = await reverseGeocode({ latitude: 37.7749, longitude: -122.4194 });

getMapkitToken(): string

Returns the MapKit token (utility function).

Returns: MapKit token string

Type Definitions

Coordinate

interface Coordinate {
  latitude: number;  // -90 to 90
  longitude: number; // -180 to 180
}

LocationSearchRegion

interface LocationSearchRegion {
  latitude: number;
  longitude: number;
  latitudeDelta: number;
  longitudeDelta: number;
}

LocationSearchOptions

interface LocationSearchOptions {
  region?: LocationSearchRegion;
  resultLimit?: number;
  includePointsOfInterest?: boolean;
  includeQueries?: boolean;
}

LocationSearchResult

interface LocationSearchResult {
  name: string;
  placemark: {
    coordinate: Coordinate;
    countryCode: string;
    postalCode: string;
    administrativeArea: string;
    subAdministrativeArea: string;
    locality: string;
    subLocality: string;
    thoroughfare: string;
    subThoroughfare: string;
    region?: {
      center: Coordinate;
      radius: number;
    };
  };
  phoneNumber?: string;
  url?: string;
}

RouteOptions

interface RouteOptions {
  transportType?: 'automobile' | 'walking' | 'transit' | 'any';
  requestsAlternateRoutes?: boolean;
}

Route

interface Route {
  distance: number;              // Distance in meters
  expectedTravelTime: number;    // Time in seconds
  name: string;
  steps: RouteStep[];
  polyline: Coordinate[];
  advisoryNotices?: string[];
}

RouteStep

interface RouteStep {
  instructions: string;
  distance: number;
  transportType: string;
  coordinate: Coordinate;
  polyline: Coordinate[];
}

ReverseGeocodeResult

interface ReverseGeocodeResult {
  formattedAddress: string;
  placemark: {
    coordinate: Coordinate;
    countryCode: string;
    postalCode: string;
    administrativeArea: string;
    subAdministrativeArea: string;
    locality: string;
    subLocality: string;
    thoroughfare: string;
    subThoroughfare: string;
    country: string;
    name: string;
    region?: {
      center: Coordinate;
      radius: number;
    };
    timeZone?: string;
  };
}

Requirements

  • iOS 13.0+
  • Expo SDK 54+
  • React Native 0.81.5+

Platform Support

  • ✅ iOS
  • ❌ Android (Apple MapKit is iOS-only)

Example

See the example app directory for a complete working example demonstrating all features of this library.

Contributing

Contributions are very welcome! Please refer to guidelines described in the contributing guide.