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

myMap.pixelToLatlng is not a function #18

Open
mikima opened this issue May 3, 2018 · 4 comments
Open

myMap.pixelToLatlng is not a function #18

mikima opened this issue May 3, 2018 · 4 comments

Comments

@mikima
Copy link

mikima commented May 3, 2018

Sorry for the continuous posting of issues.

When i try to use the pixelToLatlng() function i get this error:

Uncaught TypeError: myMap.pixelToLatlng is not a function

Here an example using it. If you open the console and click on the map you should see the error.

@cvalenzuela
Copy link
Owner

I think this has to do with how blocks and p5.js manage global variables. myMap is not defined in the global scope and p5 expects it to be. can you try running this in a local editor?

@mikima
Copy link
Author

mikima commented May 4, 2018

Yes tried in local, same problem.

It's strange since myMap is accessible in the mouseReleased(). Could it be related to the fact I'm using MapboxGL?

@cvalenzuela
Copy link
Owner

cvalenzuela commented May 4, 2018

There's a typo in the documentation it should be pixelToLatLng instead of pixelToLatlng
Just update that naming and it should work

@CU-SpaceCowboy
Copy link

I'm glad I found this. I appreciate your work! Do you mind updating the documentation on mappa.js.org to reflect this?

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

3 participants