Copy into your app
Open-source map viewer
Search full addresses with Geo Engine, select a map point for reverse lookup, and browse worldwide using keyless OpenStreetMap styles. The picker is an optional React example. The headless APIs also work with other clients.
This interactive demo loads open-source map styles only. Paid Geoapify styles are available through the Maps API for private consuming apps. See the Maps API guide for provider setup and cURL examples. Create a Geoapify BYOK key at Geoapify MyProjects.
14.599500, 120.984200
Install and configure
Copy the map-viewer folder from GitHub and the shadcn Button, Input, and Label primitives. Customize it for your project. Import MapLibre CSS in your global stylesheet, keep the source attribution visible, and configure the host app’s @/* alias and Tailwind theme. This component is an example only; the headless APIs can be used from other clients even if this viewer needs project-specific fixes.
pnpm add maplibre-gl lucide-react class-variance-authority clsx tailwind-mergemapStyles accepts custom style entries. Set defaultMapStyleId and showMapStyleSelector to control selection. Built-in OpenFreeMap styles need no provider key. Self-hosted tiles are planned.
React integration
Point the geocoding client to your BFF. It proxies forward, reverse, and full-address autocomplete and attaches the app credential server-side.
'use client';
import { useMemo } from 'react';
import { MapViewer, createMapViewerClient } from '@/components/customs/map-viewer';
export function LocationField() {
const client = useMemo(() => createMapViewerClient('/api/geo'), []);
return <MapViewer client={client} countryCode="PH" onSelect={(selection) => saveLocation(selection)} />;
}Map usage types
- Open-source
- Loaded by this demo from OpenFreeMap and OpenStreetMap public styles. No provider API key is needed.
- Paid
- Geoapify styles can be configured in a private app through the authenticated Maps API and a server-side provider key.
- Self-hosted
- Self-hosted map tiles are planned. The current OSM import supports geocoding.