How to use the leaflet-overpass-layer function in leaflet-overpass-layer

To help you get started, we’ve selected a few leaflet-overpass-layer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mapcontrib / mapcontrib / public / js / view / themeRoot.js View on Github external
if (cache && cacheUpdateSuccess) {
      this.addOverPassCacheLayer(rootLayer, layerModel, hiddenLayer);
    }

    const overPassRequest = OverPassHelper.buildRequestForTheme(
      layerModel.get('overpassRequest') || ''
    );

    const loadedBounds = [];

    if (cache && cacheBounds) {
      loadedBounds.push(cacheBounds);
    }

    const overPassLayer = new OverPassLayer({
      loadedBounds,
      debug: this._config.debug,
      endPoint: this._config.overPassEndPoint,
      minZoom: layerModel.get('minZoom'),
      timeout: this._config.overPassTimeout,
      retryOnTimeout: true,
      query: overPassRequest,
      beforeRequest: () => {
        this.showLayerLoadingProgress(layerModel);
      },
      afterRequest: () => {
        this.hideLayerLoadingProgress(layerModel);
      },
      onSuccess: receivedData => {
        const data = { ...receivedData };
        const objects = {};

leaflet-overpass-layer

This is an simple way to bring OSM data as POI overlay on your leaflet Map

MIT
Latest version published 3 years ago

Package Health Score

51 / 100
Full package analysis

Popular leaflet-overpass-layer functions