# anmolsaini16/mapcn

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/anmolsaini16-mapcn).**

5,965 stars · 300 forks · TypeScript · mit

## Links

- GitHub: https://github.com/AnmolSaini16/mapcn
- Homepage: https://mapcn.dev
- awesome-repositories: https://awesome-repositories.com/repository/anmolsaini16-mapcn.md

## Description

MapCN is a React component library that wraps MapLibre GL into declarative, composable building blocks for interactive maps. It provides a set of small, reusable components for rendering maps, placing markers, drawing routes, and clustering points, all managed through React hooks, context, and refs for state and lifecycle control.

The library distinguishes itself by offering a complete set of map features as individual React components that automatically adapt to light and dark themes. It includes components for interactive map rendering with zero configuration, marker placement with popups and drag support, route and arc drawing with click and hover events, and native point clustering for large datasets. Map controls for zoom, compass, geolocation, and fullscreen are also provided as themed components.

Beyond the core components, the library supports custom GeoJSON layers, high-performance marker layers on the WebGL canvas, and programmatic access to the map instance for building extended capabilities like real-time tracking or heatmaps. It also offers composable map UIs, custom tile provider support, and dynamic style switching.

The library is distributed as a TypeScript package and is designed to be used in React applications that need interactive, theme-aware maps without requiring API keys.

## Tags

### Web Development

- [Interactive Map Renderers](https://awesome-repositories.com/f/web-development/interactive-map-renderers.md) — Renders a full-featured interactive map using MapLibre GL with zero configuration and automatic theme switching.
- [Imperative Map Access Hooks](https://awesome-repositories.com/f/web-development/component-state-managers/map-state-hooks/imperative-map-access-hooks.md) — Provides React hooks to access the map instance, listen to events, and call methods directly from child components.
- [Geographic Route Visualization](https://awesome-repositories.com/f/web-development/routing-systems/routing/parameter-handling-utilities/path-parameter-converters/route-path-generators/geographic-route-visualization.md) — Draws routes, paths, and curved arcs between coordinates with styled lines and support for click and hover events.
- [Map Route Alternatives](https://awesome-repositories.com/f/web-development/routing/map-route-alternatives.md) — Shows multiple route alternatives and lets users select one by fetching directions from a routing API. ([source](https://mapcn.dev/docs/routes))

### Part of an Awesome List

- [GeoJSON Renderers](https://awesome-repositories.com/f/awesome-lists/devtools/map-rendering-engines/geojson-renderers.md) — Renders markers, routes, and clusters as GeoJSON layers on the WebGL canvas for high-performance visualization.
- [Interactive GeoJSON Layers](https://awesome-repositories.com/f/awesome-lists/devtools/map-rendering-engines/geojson-renderers/interactive-geojson-layers.md) — Renders custom GeoJSON data as styled layers with fill and outline that respond to hover interactions. ([source](https://mapcn.dev/docs/advanced-usage))

### Graphics & Multimedia

- [Geographic Route Drawing](https://awesome-repositories.com/f/graphics-multimedia/graphics-and-media/shape-drawing/arc-and-sector-drawing/geographic-route-drawing.md) — Draws styled routes and curved arcs between coordinates on a MapLibre map with click and hover events.
- [Geographic Point Clustering](https://awesome-repositories.com/f/graphics-multimedia/point-cloud-clustering/geographic-point-clustering.md) — Groups nearby points into clusters at low zoom levels and expands them as the user zooms in to handle large datasets. ([source](https://mapcn.dev/docs/clusters))
- [Map Point Clustering](https://awesome-repositories.com/f/graphics-multimedia/point-cloud-clustering/map-point-clustering.md) — Group close points into expandable clusters using native clustering, with configurable colors and sizes. ([source](https://mapcn.dev/docs/api-reference))
- [React Map Components](https://awesome-repositories.com/f/graphics-multimedia/visualization-mapping/mapping-libraries/react-map-components.md) — Provides declarative React components that compose into interactive map interfaces using MapLibre GL.
- [Geographic Arc Drawing](https://awesome-repositories.com/f/graphics-multimedia/graphics-and-media/shape-drawing/arc-and-sector-drawing/geographic-arc-drawing.md) — Renders quadratic Bézier arcs between two coordinates on a map, supporting per-arc styling and hover interactions. ([source](https://mapcn.dev/docs/api-reference))
- [Route Stop Markers](https://awesome-repositories.com/f/graphics-multimedia/visualization-mapping/geospatial-visualizations/custom-map-registrations/map-visual-styling/marker-visuals/route-stop-markers.md) — Places numbered markers along a drawn path to indicate stops or waypoints. ([source](https://mapcn.dev/docs/routes))
- [Custom Tile Provider Support](https://awesome-repositories.com/f/graphics-multimedia/visualization-mapping/mapping-libraries/map-tile-serving/custom-tile-provider-support.md) — Connects to any tile provider that is compatible with the map library, including OpenStreetMap, Carto, and MapTiler. ([source](https://mapcn.dev/docs))

### Mobile Development

- [Marker Interaction](https://awesome-repositories.com/f/mobile-development/marker-interaction.md) — Places DOM-based markers on a map that display custom content, open popups on click, and show tooltips on hover. ([source](https://mapcn.dev/docs/markers))
- [Markers with Popups](https://awesome-repositories.com/f/mobile-development/marker-interaction/markers-with-popups.md) — Place rich markers on a map that can display popups, tooltips, and labels when interacted with. ([source](https://cdn.jsdelivr.net/gh/anmolsaini16/mapcn@main/README.md))
- [Marker Placement](https://awesome-repositories.com/f/mobile-development/marker-placement.md) — Position a marker at a given longitude and latitude, supporting click, hover, and drag interactions. ([source](https://mapcn.dev/docs/api-reference))
- [Draggable Markers](https://awesome-repositories.com/f/mobile-development/marker-interaction/draggable-markers.md) — Repositions markers on the map by dragging them and shows the updated coordinates in a popup. ([source](https://mapcn.dev/docs/markers))

### Software Engineering & Architecture

- [Imperative-to-Declarative Bridges](https://awesome-repositories.com/f/software-engineering-architecture/imperative-to-declarative-bridges.md) — Wraps the MapLibre GL imperative API into declarative React components with hooks for state management and lifecycle control.
- [Map Instance Access Patterns](https://awesome-repositories.com/f/software-engineering-architecture/library-compatibility-managers/library-dependency-managers/shared-instance-mapping/map-instance-access-patterns.md) — Accesses the underlying map instance via hooks or refs to call methods, listen to events, and build custom features.

### User Interface & Experience

- [Imperative Map Ref Access](https://awesome-repositories.com/f/user-interface-experience/component-architectures/component-communication-patterns/ref-forwarding/imperative-map-ref-access.md) — Accesses the underlying map instance through a ref to call methods and listen to events. ([source](https://mapcn.dev/docs/advanced-usage))
- [Map Marker Tooltips](https://awesome-repositories.com/f/user-interface-experience/hover-previews/map-marker-tooltips.md) — Display a floating content box when the user hovers over a marker, which auto-dismisses on hover out. ([source](https://mapcn.dev/docs/api-reference))
- [Map Marker Managers](https://awesome-repositories.com/f/user-interface-experience/map-marker-managers.md) — Places interactive markers with popups, tooltips, and drag functionality to display rich content on map coordinates.
- [Map UI Frameworks](https://awesome-repositories.com/f/user-interface-experience/map-ui-frameworks.md) — Assembles complex map interfaces from simple, reusable components that compose together. ([source](https://mapcn.dev/docs))
- [Themed Map Controls](https://awesome-repositories.com/f/user-interface-experience/map-view-controllers/themed-map-controls.md) — Add zoom, compass, locate, and fullscreen controls that automatically adapt to light and dark mode. ([source](https://cdn.jsdelivr.net/gh/anmolsaini16/mapcn@main/README.md))
- [Zero-Configuration Map Renderers](https://awesome-repositories.com/f/user-interface-experience/map-view-controllers/themed-map-controls/zero-configuration-map-renderers.md) — Initialize a MapLibre GL map inside a component, automatically handling theme switching and providing context for child elements. ([source](https://mapcn.dev/docs/api-reference))
- [Map Marker Popups](https://awesome-repositories.com/f/user-interface-experience/styled-properties/popup-styling/contextual-popups/map-marker-popups.md) — Opens popups containing images, ratings, and action buttons when a user clicks a marker on the map. ([source](https://mapcn.dev/docs/markers))
- [Map Style Theme Switching](https://awesome-repositories.com/f/user-interface-experience/styling-theming-systems/content-styling/styling-architectures/map-style-theme-switching.md) — Switches between light and dark map styles automatically based on the user's theme preference. ([source](https://mapcn.dev/docs))
- [Browser Geolocation Detectors](https://awesome-repositories.com/f/user-interface-experience/element-locators/framework-specific-locators/physical-location-locators/browser-geolocation-detectors.md) — Uses the browser's geolocation API to find and center the map on the user's current location. ([source](https://mapcn.dev/docs/controls))
- [Windowed Fullscreen Toggles](https://awesome-repositories.com/f/user-interface-experience/presentation-frameworks/presentation-modes/fullscreen-controls/windowed-fullscreen-toggles.md) — Switches the map display between windowed and fullscreen view to maximize the visible area. ([source](https://mapcn.dev/docs/controls))
- [Map Popups](https://awesome-repositories.com/f/user-interface-experience/styled-properties/popup-styling/contextual-popups/map-popups.md) — Render a content popup attached to a marker on click or at a standalone coordinate on the map. ([source](https://mapcn.dev/docs/api-reference))
- [Coordinate](https://awesome-repositories.com/f/user-interface-experience/viewport-navigation-controls/zoom-animations/coordinate.md) — Zooms the map to a specified geographic coordinate or bounding box with a smooth animated transition. ([source](https://mapcn.dev/docs/controls))

### Artificial Intelligence & ML

- [Spatial Clustering](https://awesome-repositories.com/f/artificial-intelligence-ml/clustering-algorithms/spatial-clustering.md) — Uses MapLibre GL's built-in clustering algorithm to group nearby points into expandable clusters with configurable appearance.

### Data & Databases

- [Extended Map Layer Capabilities](https://awesome-repositories.com/f/data-databases/data-mapping-utilities/data-dependency-visualizers/data-mapping-visualizers/map-layer-substitutions/extended-map-layer-capabilities.md) — Supports custom GeoJSON layers, real-time tracking, geofencing, heatmaps, and other extended map capabilities.
- [Extended Map Layer Capabilities](https://awesome-repositories.com/f/data-databases/data-mapping-utilities/data-dependency-visualizers/data-mapping-visualizers/map-layer-substitutions/extended-map-layer-capabilities/extended-map-layer-capabilities.md) — Extends the map with real-time tracking, geofencing, heatmaps, drawing tools, 3D buildings, animations, and custom data layers. ([source](https://mapcn.dev/docs/advanced-usage))
- [Map Marker Layers](https://awesome-repositories.com/f/data-databases/data-visualization-charts/high-performance-visualizers/map-marker-layers.md) — Renders hundreds or thousands of markers as GeoJSON layers on the WebGL canvas for high performance. ([source](https://mapcn.dev/docs/advanced-usage))

### Operating Systems & Systems Programming

- [Map Compass Displays](https://awesome-repositories.com/f/operating-systems-systems-programming/display-layout-mapping/map-compass-displays.md) — Displays a compass rose that indicates the current map bearing and can be clicked to reset north. ([source](https://mapcn.dev/docs/controls))
