Featuregrid imports `toLatLngBounds` which leaflet exports as `latLngBounds`.
See original GitHub issueDescribe the bug
In the latest version of esri-leaflet, FeatureGrid.js imports toLatLngBounds
from leaflet, which is not exported by leaflet 1.6.0. It is exported as latLngBounds
. This results in an error in our rollup build. See the following logs:
[!] Error: 'toLatLngBounds' is not exported by node_modules/leaflet/dist/leaflet-src.esm.js
https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module
node_modules/esri-leaflet/src/Layers/FeatureLayer/FeatureGrid.js (3:2)
1: import {
2: LatLngBounds,
3: toLatLngBounds as latLngBounds,
^
4: Layer,
5: Browser,
Error: 'toLatLngBounds' is not exported by node_modules/leaflet/dist/leaflet-src.esm.js
We temporarly fixed it with an automatic replacement of the codeline after the installation of the npm modules.
Expected behavior
I expect the FeatureGrid.js to import latLngBounds
instead of toLatLngBounds
. You can see the export of toLatLngBounds
as latLngBounds
in the leaflet repository.
Environment Information
- Version of Leaflet (
1.6.0
): - Version of Esri Leaflet (
2.4.0
): - Your OS: [macOS]
- Browser and Version (error occurs on build time)
Additional context
We are working on an angular component library which is bundled by rollup and built by bazel.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Documentation - a JavaScript library for interactive maps
All Leaflet methods that accept LatLngBounds objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above...
Read more >How to use the leaflet.LatLng function in leaflet - Snyk
export const toLatLngBounds = function(arrayBounds) { if ... const northEast = new LatLng(arrayBounds[3], arrayBounds[2]) return new LatLngBounds(southWest, ...
Read more >Bounds is not valid - angular - Stack Overflow
I'm trying to implement a leaflet map where the zoom level dynamically ... import { Component, Input, OnChanges } from '@angular/core'; ...
Read more >types/leaflet/index.d.ts - UNPKG
The CDN for @types/leaflet. ... 14, export as namespace L;. 15. 16, import * as geojson from 'geojson'; ... 169, export class LatLngBounds...
Read more >Fixed Bounds | Vue Leaflet
Marker is placed at 47.41322, -1.219482, bounds are { "_southWest": { "lat": ... import { LMap, LTileLayer, LMarker } from "vue2-leaflet"; export default ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@nisarmd If you’ve just started seeing it, I think your issue is probably the same as in this thread: https://github.com/Esri/esri-leaflet/issues/1342#issuecomment-1255277662
@jwasilgeo Started seeing this issue with the following versions -
Log - node_modules/esri-leaflet/src/Layer/FeatureLayer/FeatureGrid.js - Error: export ‘toLatLngBounds’ (imported as ‘latLngBounds’) was found in ‘leaflet’