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

Provide instructions to actually render a map for a beginner? #78

Open
rmallick6806 opened this issue Sep 3, 2024 · 2 comments
Open
Assignees
Labels
question Further information is requested

Comments

@rmallick6806
Copy link

rmallick6806 commented Sep 3, 2024

Can you provide a working code recipe for how to render a mapbox (or any map for that matter), a three js scene.

Here's a snippet I have added to the intro scene in ThreeJS: https://threejs.org/docs/#manual/en/introduction/Creating-a-scene, and while the cube renders, I don't see anything else happening from geo-three.

  // Create a map tiles provider object
  const provider = new MapBoxProvider(
    apiKey,
    'mapbox/satellite-v9',
    MapBoxProvider.STYLE,
    'png',
    false,
    'v9'
  );
  // Create the map view and add it to your THREE scene
  const map = new MapView(MapView.PLANAR, provider);
  scene.add(map);
@tentone
Copy link
Owner

tentone commented Sep 3, 2024

The sample available on the readme page already has that purpose

var provider = new OpenStreetMapsProvider();
var map = new MapView(MapView.PLANAR, provider);
scene.add(map);
map.scale.set(0.001, 0.001, 0.001);

This code should be enought to have a map object in threejs fully working

@tentone tentone self-assigned this Sep 3, 2024
@tentone tentone added the question Further information is requested label Sep 3, 2024
@rmallick6806
Copy link
Author

@tentone I don't see anything rendering on screen. Can you provide a repl?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants