cvalenzuela / Mappa

A canvas wrapper for Maps 🗺 🌍
https://mappa.js.org
359 stars 104 forks source link

myMap.pixelToLatlng is not a function #18

Open mikima opened 6 years ago

mikima commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

CU-SpaceCowboy commented 5 years ago

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