Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Angular
  3. ngx-leaflet

ngx-leaflet

MITTypeScript

Core Angular integration library for Leaflet maps, providing directives and components for flexible map management.

GitHubGitHub
809 stars136 forks0 contributors

What is ngx-leaflet?

@bluehalo/ngx-leaflet is an Angular wrapper library for Leaflet, the popular open-source JavaScript library for interactive maps. It provides Angular directives and components that allow developers to embed and control Leaflet maps declaratively within Angular applications, handling map creation, layer management, and event binding through Angular's data flow.

Target Audience

Angular developers building web applications that require interactive, embeddable maps—such as dashboards, data visualization tools, location-based services, or geospatial analysis platforms.

Value Proposition

Developers choose ngx-leaflet because it offers a seamless, idiomatic Angular API for Leaflet, eliminating the need to manually bridge Angular's change detection with Leaflet's imperative API. It provides reactive map controls, comprehensive event integration, and extensibility through official plugins, making it the standard choice for Leaflet maps in Angular ecosystems.

Overview

Core Leaflet package for Angular.io

Use Cases

Best For

  • Embedding interactive maps in Angular dashboards
  • Building data visualization apps with dynamic map layers
  • Creating location-based Angular applications with custom markers and shapes
  • Developing geospatial tools with reactive map controls
  • Integrating Leaflet maps with Angular's forms and state management
  • Adding user-controlled base layer toggles and overlays in Angular

Not Ideal For

  • Projects not using Angular or migrating to a different framework
  • Applications needing out-of-the-box map embeds with zero asset configuration
  • High-performance mapping with thousands of dynamic layers where deep change detection is too slow
  • Server-side rendered apps where Leaflet's client-side DOM conflicts with Angular Universal

Pros & Cons

Pros

Directive-Based Declarative Syntax

Uses Angular directives like leaflet and leafletLayers for intuitive, template-driven map setup, making it feel native to Angular developers, as shown in the basic usage examples.

Reactive Layer Updates

Supports dynamic layer management through bindings with mutable array handling, allowing easy updates without immutable data structures, though performance optimizations are needed for large sets.

Angular Zone-Integrated Events

Map and layer events are exposed as Angular outputs and run within the Angular zone, ensuring proper change detection without extra boilerplate, as documented in the events section.

Official Plugin Extensions

Has dedicated extensions for Leaflet Draw, Markercluster, and D3, enabling seamless integration of advanced mapping features, listed in the Extensions part of the README.

Cons

Cumbersome Asset Setup

Requires manual configuration of Leaflet CSS and marker images in Angular CLI projects, adding initial overhead, as detailed in the 'A Note About Markers' section with steps for asset copying.

Performance Pitfalls with Layers

Mutable layer arrays trigger deep comparisons that can degrade performance with many layers, necessitating workarounds like layer groups or OnPush change detection, admitted in the mutable layers documentation.

Limited Event Coverage

Not all Leaflet events are exposed; developers must manually handle some events using NgZone or ChangeDetectorRef, increasing complexity, as noted in the change detection warnings.

Frequently Asked Questions

Quick Stats

Stars809
Forks136
Contributors0
Open Issues2
Last commit6 days ago
CreatedSince 2016

Tags

#web-mapping#geospatial#frontend#angular-directives#maps#openstreetmap#angular#interactive-maps#leaflet

Built With

A
Angular
T
TypeScript
L
Leaflet

Included in

Angular10.0k
Auto-fetched 4 hours ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub