Giter Site home page Giter Site logo

Comments (8)

cvalenzuela avatar cvalenzuela commented on May 21, 2024

Is there any particular reason you are using p5 in instance mode?

from mappa.

sergitrilles avatar sergitrilles commented on May 21, 2024

We are developing a webapp to create notebooks with some bock types (text, code, maps,...). One of these types is P5. The final user can write and execute p5 code on "live".

from mappa.

cvalenzuela avatar cvalenzuela commented on May 21, 2024

I tried your code, removing the the $("#mappa").detach().appendTo("#kajero-p5-3"); in the draw function, and it works. Are you trying to append the mappa instance to another component? Try with p5 parent() method and there's no need to reference this in the draw loop.

from mappa.

sergitrilles avatar sergitrilles commented on May 21, 2024

Yes, I have to do that to move the map inside the div (see https://forum.processing.org/two/discussion/26239/p5-js-mappa-js-unable-to-place-map-in-parent-div)

With p5 parent is not working, I tried with mappa and canvas element.

Thanks

from mappa.

cvalenzuela avatar cvalenzuela commented on May 21, 2024

Do you have p5.dom.js in your sketch?

All the examples on the website are appending the canvas to another div with .parent(). Take a look at: https://github.com/cvalenzuela/Mappa/blob/master/docs/assets/scripts/tile-leaflet.js#L23

from mappa.

sergitrilles avatar sergitrilles commented on May 21, 2024

Yes, I have p5.dom . But, removing $("#mappa").detach().appendTo("#DivName"); and using .parent() the map is drawing outside the Div.
But, the problem is not that and continues, when I run this sketch two times, the map disappears. And the overlay gets an error

from mappa.

cvalenzuela avatar cvalenzuela commented on May 21, 2024

It seems the example from the Processing forum was using version 0.0.4 directly from npm.
Version 0.0.5 had this bug solved, but I never updated the package on npm. by bad!

Here's the same CodePen from the forum but with version 0.0.5

https://codepen.io/anon/pen/Zxeemq

thanks for pointing this out! I just updated the version on npm!

from mappa.

sergitrilles avatar sergitrilles commented on May 21, 2024

Perfect! Thanks a lot!

from mappa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.