Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@any-routing/maplibre-layers-event-propagator

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@any-routing/maplibre-layers-event-propagator

Maplibre GL and MapBox GL JS map engine add-on to stop event propagation between layers.

  • 0.0.3
  • npm
  • Socket score

Version published
Weekly downloads
21
increased by162.5%
Maintainers
1
Weekly downloads
 
Created
Source

maplibre-layers-event-propagator

Maplibre GL and MapBox GL JS map engine add-on to stop event propagation between layers.

Installation

npm i --save @any-routing/maplibre-layers-event-propagator

Example of usage

import { Map } from 'maplibre';
import { PropagationEvent, setupLayerEventsPropagator } from '@any-routing/layers-event-propagator';

const map = new Map({});

map.on('load', () => {
  setupLayerEventsPropagator(map); // Must be handled after map loaded

  map.on('click', 'lake-label', (e: PropagationEvent<MapLayerMouseEvent>) => {
    console.log(e, 'click on water label printed');
    e.stopPropagation ? e.stopPropagation() : null;
    e.stopImmediatePropagation ? e.stopImmediatePropagation() : null;
  });

  map.on('click', 'lake-label', (e: PropagationEvent<MapLayerMouseEvent>) => {
    console.log(e, 'click on water label no printed');
    e.stopPropagation ? e.stopPropagation() : null;
  });

  map.on('click', 'water', (e: PropagationEvent<MapLayerMouseEvent>) => {
    console.log(e, 'click on water');
    e.stopPropagation ? e.stopPropagation() : null;
  });

  map.on('click', (e: PropagationEvent<MapLayerMouseEvent>) => {
    console.log(e, 'click anywhere else');
  });
});

FAQs

Package last updated on 09 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc