Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with classList and sample code #21

Open
Chenart opened this issue Jul 6, 2019 · 1 comment
Open

Issue with classList and sample code #21

Chenart opened this issue Jul 6, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@Chenart
Copy link

Chenart commented Jul 6, 2019

Hi Public Lab team!

Problem

When I use the leaflet-tile-filter sample code in my React app, I get the following compile error: ''TypeError: Cannot read property 'classList' of undefined", which occurs in leaflet.tile-filter.js

Here is an image of the full error dump:
image

Attempted Fix

I commented out the code (lines 9 and 10 in the source code) to avoid the error, and this does allow my app to compile. However, I have a feeling that this breaks other functionality of leaflet.tile-filter, because the 'ndvi' filter is not showing up.

I also tried testing on the index.html file sample code in the node module, but I get a page that doesn't render the map.

Environment:

I'm using the latest version of Chrome on Windows, and I'm using React with Webpack.
I am using vanilla Leaflet, however, not react-leaflet.

As well, I have imported jquery and image-sequencer as dependencies.

Would you have any ideas as to why this error would be occurring, and how I might fix it?
Thank you for your help!

@jywarren
Copy link
Member

jywarren commented Jul 9, 2019

Hi, thanks for posting the issue! Can you share any of your code so we can see what's going on? Indeed, this extra set of classes helps us track which tiles have been replaced with filtered tiles. So they are necessary. I'm not sure what is causing your tileLayer to be undefined, though! How are you setting this up?

@jywarren jywarren added the bug Something isn't working label Jul 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants