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

initialize function issue #40

Open
gete76 opened this issue Aug 21, 2015 · 5 comments
Open

initialize function issue #40

gete76 opened this issue Aug 21, 2015 · 5 comments

Comments

@gete76
Copy link
Contributor

gete76 commented Aug 21, 2015

Not sure if this is really a bug but more to do with intention. I noticed the new changes now load the Utfgrid with 'this' as the parameter to be passed for the window parameter. Passing 'this' assumes that in the context of loading this file that 'this' is the window object or some other object with global functions. I now get a window.setTimeout is not function because I load Utfgrid into a browserify module and 'this' is definitely not the window object in its context. What's the purpose of passing 'this' and not 'window' in the wrapper function?

@danzel
Copy link
Owner

danzel commented Aug 21, 2015

When did we change this?

@gete76
Copy link
Contributor Author

gete76 commented Aug 21, 2015

My apologies, I read the diff history wrong. I did pull down changes today. Though I'm still trying to understand what broke. The _process_request function in dist/leaflet.utfgrid.js throws a window.setTimeout is not a function. I found that 'this' passed as the parameter in the loading function is not the window object or global context as expected according to the code. Though this worked fine before when loaded in a browserify module. Any ideas? My own solution was to just change 'this' to 'window' .

@danzel
Copy link
Owner

danzel commented Aug 22, 2015

Might have been #28

@gete76
Copy link
Contributor Author

gete76 commented Aug 23, 2015

Is it okay if I submit a pull request for this?

@danzel
Copy link
Owner

danzel commented Aug 23, 2015

Yeah please do

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants