Comments (1)
Turns out it's easier than I thought.
just make sure to add the useMap()
on React component contained within a CanvasMap
item.
const Layer = () => {
const map = useMap();
map.addLayer(
{
//...
return null
}
//...
<CanvasMap>
<Layer />
</CanvasMap>
![image](https://private-user-images.githubusercontent.com/133435610/294616627-e7327225-4e96-41cb-a505-27d2872b6cf6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTAyNDE4OTEsIm5iZiI6MTcxMDI0MTU5MSwicGF0aCI6Ii8xMzM0MzU2MTAvMjk0NjE2NjI3LWU3MzI3MjI1LTRlOTYtNDFjYi1hNTA1LTI3ZDI4NzJiNmNmNi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwMzEyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDMxMlQxMTA2MzFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT02ZjAyYWVmOTQ2NGFiMDUzZGM5YTM5OTZmODMzNmY5YmY4YWU2MDZjZTdjMWRlMGY2ZDI3YmJiOTk1NDI2MjU5JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.Q7Rg8MO6UJtWDF8dGNX9B1VMcY_vYIl6rRuUPwSWGuU)
from react-three-map.
Related Issues (20)
- Globe HOT 1
- Camera controls HOT 1
- Imperative coordinates manipulation HOT 7
- THREE.Shape() & <extrudeGeometry args={[shape, options]} /> HOT 9
- line with coordinates as points HOT 2
- Light sources not applied within `<Coordinates>` HOT 2
- Allow to set a custom layer ID, and layer properties HOT 4
- Raycasting inaccuracy
- using <EffectComposer> or <Effects> from r3/drei HOT 2
- mercator line HOT 1
- Pinpoint scale effect HOT 1
- Integration inside another canvas HOT 4
- Models below surface clipped at certain camera angles HOT 1
- Use ThreeJS as a canvas overlay
- Base map HOT 1
- React Native HOT 1
- Object controls on top of 3D Map HOT 5
- Checking whether or not the 3D environment is inside the polygon HOT 2
- Examples Error HOT 1
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 react-three-map.