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

react-native-bus-tracking-map-pro

v1.3.1

Published

Production-ready React Native bus tracking map with WebSocket, OSRM routing, multi-bus support and dark mode

Readme

react-native-bus-tracking-map-pro

🚌 Production-ready React Native map — bus tracking, live WebSocket, My Location button, dark/satellite mode, multi-bus, road routing, and more.


Install

npm install react-native-bus-tracking-map-pro react-native-webview
cd ios && pod install   # iOS only

Quick Examples

1️⃣ Only Map (no route, no bus)

import { BusTrackingMap } from 'react-native-bus-tracking-map-pro';

<BusTrackingMap mode="static" />

2️⃣ Route Only (no live bus)

import { BusTrackingMap } from 'react-native-bus-tracking-map-pro';

<BusTrackingMap route={ROUTE} mode="route" />

3️⃣ Static Bus (manual position)

import { BusTrackingMap } from 'react-native-bus-tracking-map-pro';
<BusTrackingMap
  route={ROUTE}
  buses={[{ id: 'bus1', lat: 28.61, lng: 77.37, label: 'Bus A' }]}
/>

4️⃣ Live Tracking (WebSocket — optional)

import { BusTrackingMap } from 'react-native-bus-tracking-map-pro';
<BusTrackingMap
  route={ROUTE}
  wsUrl="ws://your-server.com:3000"
  showTrail
  showStatusBadge
/>

5️⃣ Dark / Satellite Mode

<BusTrackingMap route={ROUTE} theme="dark" />
<BusTrackingMap route={ROUTE} theme="satellite" />

WebSocket Message Formats

Server se koi bhi format bhejo — sab supported hai:

// Multi-bus
{ "buses": [{ "id": "bus1", "lat": 28.61, "lng": 77.37 }] }

// Array directly
[{ "id": "bus1", "lat": 28.61, "lng": 77.37 }]

// Single bus (id optional, default 'bus1')
{ "id": "bus1", "lat": 28.61, "lng": 77.37 }

All Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | route | Route | — | Start, stops[], end | | mode | 'tracking' \| 'route' \| 'static' | auto | Map mode | | buses | Bus[] | [] | Static bus positions | | wsUrl | string | — | WebSocket URL (optional, only for live) | | autoReconnect | boolean | true | Auto reconnect WS | | followBusId | string | — | Pan map to this bus | | theme | 'light' \| 'dark' \| 'satellite' \| 'terrain' | 'light' | Map style | | zoom | number | 14 | Initial zoom | | center | {lat, lng} | route.start | Override map center | | showRoute | boolean | true | OSRM road line | | showTrail | boolean | true | Bus path trail | | trailMaxPoints | number | 100 | Max trail history points | | showStops | boolean | true | Stop markers | | showStartEnd | boolean | true | Start/End markers | | showMyLocationButton | boolean | true | 📍 My Location button | | showZoomControls | boolean | true | +/- zoom buttons | | showStatusBadge | boolean | auto | WS live status badge | | showScaleBar | boolean | false | Scale bar | | showSpeed | boolean | false | Bus speed in popup | | onBusPress | (bus) => void | — | Bus tap event | | onStopPress | (stop) => void | — | Stop tap event | | onMapPress | (latlng) => void | — | Map tap event | | onMyLocation | (latlng) => void | — | My location result | | onWsConnect | () => void | — | WS connected | | onWsDisconnect | () => void | — | WS disconnected | | style | ViewStyle | — | Container style | | height | number | — | Fixed height (px) |


Types

type Route = {
  start: Location;
  stops?: Location[];
  end: Location;
};

type Location = {
  lat: number;
  lng: number;
  name?: string;
};

type Bus = {
  id: string;
  lat: number;
  lng: number;
  label?: string;     // shown below icon
  color?: string;     // trail color e.g. '#9C27B0'
  heading?: number;   // 0-360
  speed?: number;     // km/h
};

Peer Dependencies

react >= 17
react-native >= 0.68
react-native-webview >= 11

License

MIT

react-native-bus-tracking-map-pro