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

@object-ui/plugin-map

v4.3.0

Published

Map visualization plugin for Object UI

Readme

@object-ui/plugin-map

Map visualization plugin for Object UI - Display geographic data with interactive maps.

Features

  • Interactive Maps - Zoomable, pannable map visualization
  • Markers - Add markers with custom icons and popups
  • Layers - Multiple map layers support
  • Geolocation - User location detection
  • Customizable - Tailwind CSS styling support
  • Responsive - Mobile-friendly map controls

Installation

pnpm add @object-ui/plugin-map

Usage

Automatic Registration (Side-Effect Import)

// In your app entry point (e.g., App.tsx or main.tsx)
import '@object-ui/plugin-map';

// Now you can use map types in your schemas
const schema = {
  type: 'map',
  center: { lat: 37.7749, lng: -122.4194 },
  zoom: 12,
  markers: [
    { lat: 37.7749, lng: -122.4194, label: 'San Francisco' }
  ]
};

Manual Registration

import { mapComponents } from '@object-ui/plugin-map';
import { ComponentRegistry } from '@object-ui/core';

// Register map components
Object.entries(mapComponents).forEach(([type, component]) => {
  ComponentRegistry.register(type, component);
});

Schema API

Map

Display an interactive map:

{
  type: 'map',
  center: { lat: number, lng: number },
  zoom?: number,                  // Default: 10
  markers?: MapMarker[],
  layers?: MapLayer[],
  height?: number | string,
  onMarkerClick?: (marker) => void,
  className?: string
}

Map Marker

interface MapMarker {
  lat: number;
  lng: number;
  label?: string;
  icon?: string;                  // Icon URL or name
  popup?: string | ReactNode;
  color?: string;                 // Marker color
}

Examples

Basic Map

const schema = {
  type: 'map',
  center: { lat: 40.7128, lng: -74.0060 },
  zoom: 13,
  height: 500,
  markers: [
    {
      lat: 40.7128,
      lng: -74.0060,
      label: 'New York City',
      popup: 'The Big Apple'
    }
  ]
};

Multiple Markers

const schema = {
  type: 'map',
  center: { lat: 37.7749, lng: -122.4194 },
  zoom: 10,
  markers: [
    {
      lat: 37.7749,
      lng: -122.4194,
      label: 'San Francisco',
      color: 'red',
      popup: 'Golden Gate Bridge'
    },
    {
      lat: 37.8044,
      lng: -122.2712,
      label: 'Oakland',
      color: 'blue',
      popup: 'Port of Oakland'
    },
    {
      lat: 37.3382,
      lng: -121.8863,
      label: 'San Jose',
      color: 'green',
      popup: 'Silicon Valley'
    }
  ]
};

Interactive Map

const schema = {
  type: 'map',
  center: { lat: 51.5074, lng: -0.1278 },
  zoom: 12,
  markers: [/* markers */],
  onMarkerClick: (marker) => {
    console.log('Marker clicked:', marker);
    // Show marker details
  },
  onMapClick: (coordinates) => {
    console.log('Map clicked at:', coordinates);
    // Add new marker
  }
};

Map with Data Binding

const schema = {
  type: 'map',
  center: { lat: 37.7749, lng: -122.4194 },
  zoom: 10,
  markers: '${data.locations.map(loc => ({ lat: loc.latitude, lng: loc.longitude, label: loc.name }))}',
  onMarkerClick: (marker) => {
    // Handle marker click
  }
};

Integration with ObjectQL

Connect map to ObjectStack data sources:

import { createObjectStackAdapter } from '@object-ui/data-objectstack';

const dataSource = createObjectStackAdapter({
  baseUrl: 'https://api.example.com',
  token: 'your-auth-token'
});

const schema = {
  type: 'object-map',
  dataSource,
  object: 'locations',
  latField: 'latitude',
  lngField: 'longitude',
  labelField: 'name',
  popupField: 'description',
  center: { lat: 37.7749, lng: -122.4194 },
  zoom: 10
};

Map Features

Custom Markers

const schema = {
  type: 'map',
  markers: [
    {
      lat: 40.7128,
      lng: -74.0060,
      icon: '/custom-marker.png',
      popup: {
        type: 'card',
        title: 'Location Details',
        body: 'Custom popup content'
      }
    }
  ]
};

Geolocation

const schema = {
  type: 'map',
  useGeolocation: true,           // Center map on user's location
  zoom: 15,
  markers: []
};

Map Layers

const schema = {
  type: 'map',
  center: { lat: 37.7749, lng: -122.4194 },
  layers: [
    { type: 'heatmap', data: [/* heatmap data */] },
    { type: 'polygon', coordinates: [/* polygon coordinates */], color: 'rgba(255, 0, 0, 0.3)' }
  ]
};

TypeScript Support

import type { MapSchema, MapMarker } from '@object-ui/plugin-map';

const marker: MapMarker = {
  lat: 37.7749,
  lng: -122.4194,
  label: 'San Francisco',
  color: 'red'
};

const map: MapSchema = {
  type: 'map',
  center: { lat: 37.7749, lng: -122.4194 },
  zoom: 12,
  markers: [marker]
};

Customization

Style the map with Tailwind classes:

const schema = {
  type: 'map',
  className: 'rounded-lg shadow-xl border-2 border-gray-200',
  height: '600px',
  center: { lat: 37.7749, lng: -122.4194 }
};

Compatibility

  • React: 18.x or 19.x
  • Node.js: ≥ 18
  • TypeScript: ≥ 5.0 (strict mode)
  • @objectstack/spec: ^3.3.0
  • @objectstack/client: ^3.3.0
  • Tailwind CSS: ≥ 3.4 (for packages with UI)

Links

License

MIT — see LICENSE.