Coder Social home page Coder Social logo

codelab-3d-maps-webgl-js's People

Contributors

amuramoto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

codelab-3d-maps-webgl-js's Issues

Errors in npm install and npm start

Hi

I am doing the code lab using this codes and I got the error during installation and start.
npm fix or force fix will not remove the error.
I am testing the code on localhost

Thanks

Error showing code in the Documentation

In this section https://developers.google.com/codelabs/maps-platform/webgl#3, it has a mistake showing the function initWebGLOverlayView(map) but it's WebglOverlayView() and inside this function webglOverlayView.onContextRestored = ({gl}) => {} and webglOverlayView.onDraw = ({gl, coordinateTransformer}) => {}, the parameters are without curly parentheses.

And here: https://developers.google.com/codelabs/maps-platform/webgl#5 , you use the parameter transformer, but in the rest of the documentation and sample code use coordinateTransformer.

infinit ondraw

image

I found that webGLOverlayView.onDraw will run infinitely, anyway we can stop it if there is no movement?

Footprint/Outline of the buildings?

Since the map itself is vector and also 3D buildings are available on the map itself, is there a way to extract the building outlines or even the volume of the building?

Actually exactly this example here: https://geo-devrel-io2021-travel.web.app/#hotels (I assume the green Hotel is customly generated based on the polygon or vertices information of the hotel (provided by the API itself)?

webglOverlayView callbacks never get called

Hi,

I've been trying to use google.maps.WebglOverlayView in my toy app, but couldn't make it work.
So I tested this project, and it seems I'm hitting the same issue.

After removing the plugins from webpack.config.js (does not seem to be needed for maps to work, as API is in app.js), and running npm i; npm start, I see the maps opening, but no 3D objects.

I added logging to various places, and while initWebglOverlayView gets called, the event handlers defined there never are (e.g. webglOverlayView.onAdd).

I suspect something might have changed with your APIs, as I see examples in your documentation now using "ThreeJSOverlayView", which is not documented in the "Reference" section of your docs.

Does not work with environment map

Hi and thanks a ton for this great feature in Google maps / this example!

I was trying to use an environment map (with metalness / roughness - values) on my model and noticed that this doesn't seem to work with WebGLOverlayView. The reflections of the environment map on the object are static and are not updating correctly. I'm not sure if the problem is in my setup or in WebGLOverlayViewor in ThreeJS.

The video shows the result with Google Maps and WebGLOverlayView on top and the result with "normal" ThreeJS on the bottom.

2022-04-17.23-37-31.mp4

Here are my change to your code:

    // load the model    
    loader = new GLTFLoader();
    const source = "pin.gltf";
    loader.load(
      source,
      gltf => {
        gltf.scene.scale.set(25, 25, 25);
        gltf.scene.rotation.x = 180 * Math.PI / 180; // rotations are in radians

        scene.add(gltf.scene);

+        // Load Environment Map
+        new EXRLoader().load("/furry_clouds_2k.exr", texture => {
+          const pmremGenerator = new THREE.PMREMGenerator(renderer);
+          const exrCubeRenderTarget = pmremGenerator.fromEquirectangular(texture);

+          // Apply Environment Map
+          gltf.scene.traverse(o => {
+            if (o.material) {
+              o.material.envMap = exrCubeRenderTarget.texture;
+              o.material.envMapIntensity = 1;
+              o.material.metalness = 1;
+              o.material.roughness = 0.1;
+              o.material.needsUpdate = true;
+            }
+          });
+        });
      }
    );

It's a pretty simple code change and I'm clueless why it's behaving like this. Please help!

PS: I also noticed that your GLTF has all inverted faces. It's not visible in your demo, but if you start changing the material settings, it becomes noticeable. Do you want a PR ๐Ÿ™‚ ?

Small typos in the webgl code lab text

Step 4. " and what you should it them for:" - switch "it" for "use"
Step 5. "...every object manually and then some. To make things..." - Something is missing after "some.

Request for an example to geolocate object/mesh/etc

Would you consider adding an example that anchors a mesh or gltf model to a fixed lat/long location on the map and scales it accordingly as the camera is rotated and moved toward/away? That would be tremendously helpful. Sort of like the data layer for the maps/webGL. Thanks in advance.

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.