Comments (8)
Is there any particular reason you are using p5 in instance mode?
from mappa.
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.
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.
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.
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.
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.
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.
Perfect! Thanks a lot!
from mappa.
Related Issues (20)
- how to use with d3?
- how to use OffMaps,for example leaflet
- Touch interactions not working on MapboxGL (but work on Mapbox) HOT 1
- leaflet canvas render
- Allow for existing map to be passed into Mappa.
- Canvas element doesn't seem to update after window resize HOT 4
- Cannot draw on top of the tilemap.
- Map Size on retina devices HOT 1
- Using Leaflet methods with Mappa
- Mappa basic example not working HOT 3
- myMap.overlay(canvas) yields error: Cannot set property 'onload' of undefined HOT 1
- Example of using mappa without p5.js
- Can not control the position of map
- How to access map provider members? HOT 1
- Examples do not work
- Can I resize the map
- Destroy a whole Map? HOT 1
- Trying to make mappa and p5 work inside a React component.
- Uncaught type error when I attempt to redraw the map and overlay after deleting it. HOT 1
- Active development?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mappa.