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

[Bug]Using @deck.gl/arcgis@9.0.14: deck.getTooltip({object}) the parameter object is undefined. #8818

Open
2 of 7 tasks
gdnwr opened this issue Apr 23, 2024 · 7 comments
Open
2 of 7 tasks
Labels

Comments

@gdnwr
Copy link

gdnwr commented Apr 23, 2024

Description

Using @deck.gl/arcgis@9.0.14:
The value of the parameter "object" in the getTooltip function is undefined.

const layer = new arcGIS.DeckLayer();

layer.deck.getTooltip = ({ object }) => {
  // deck.gl@9.0.14 @deck.gl/arcgis@9.0.14
  // object is undefined
  console.log("deck.getTooltip", object);
  return object?.properties?.name;
};

Flavors

  • Script tag
  • React
  • Python/Jupyter notebook
  • MapboxOverlay
  • GoogleMapsOverlay
  • CartoLayer
  • ArcGIS

Expected Behavior

No response

Steps to Reproduce

@deck.gl/arcgis@9.0.14:
https://codesandbox.io/p/sandbox/arcgis-deck-forked-9m52cr?file=%2Findex.html
image

@deck.gl/arcgis@8.9.35:
https://codesandbox.io/p/sandbox/arcgis-deck-forked-pg687r?file=%2Findex.html%3A59%2C28
image

Environment

  • Framework version: @deck.gl/arcgis@9.0.12
  • Browser: chrome 124.0
  • OS: windows11

Logs

No response

@gdnwr gdnwr added the bug label Apr 23, 2024
@gdnwr gdnwr changed the title [Bug]Using @deck.gl/arcgis@9.0.9: deck.getTooltip({object}) the parameter object is undefined. [Bug]Using @deck.gl/arcgis@9.0.10: deck.getTooltip({object}) the parameter object is undefined. Apr 26, 2024
@gdnwr gdnwr changed the title [Bug]Using @deck.gl/arcgis@9.0.10: deck.getTooltip({object}) the parameter object is undefined. [Bug]Using @deck.gl/arcgis@9.0.11: deck.getTooltip({object}) the parameter object is undefined. Apr 28, 2024
@gdnwr gdnwr changed the title [Bug]Using @deck.gl/arcgis@9.0.11: deck.getTooltip({object}) the parameter object is undefined. [Bug]Using @deck.gl/arcgis@9.0.12: deck.getTooltip({object}) the parameter object is undefined. Apr 30, 2024
@Pessimistress
Copy link
Collaborator

https://github.com/visgl/deck.gl/tree/master/examples/get-started/pure-js/arcgis works as expected.

Please provide fully functional code to reproduce your issue. We cannot debug from screenshots.

@gdnwr
Copy link
Author

gdnwr commented May 8, 2024

https://github.com/visgl/deck.gl/tree/master/examples/get-started/pure-js/arcgis works as expected.

Please provide fully functional code to reproduce your issue. We cannot debug from screenshots.

Hello, are examples from CodeSandbox not acceptable?
https://codesandbox.io/p/sandbox/arcgis-deck-forked-9m52cr?file=%2Findex.html

<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta
      name="viewport"
      content="initial-scale=1,maximum-scale=1,user-scalable=no"
    />
    <title>
      Build a custom layer view using deck.gl | Sample | ArcGIS Maps SDK for
      JavaScript 4.29
    </title>

    <script src="https://unpkg.com/deck.gl@9.0.14/dist.min.js"></script>
    <script src="https://unpkg.com/@deck.gl/layers@9.0.14/dist.min.js"></script>
    <script src="https://unpkg.com/@deck.gl/arcgis@9.0.14/dist.min.js"></script>
    <link
      rel="stylesheet"
      href="https://js.arcgis.com/4.29/esri/themes/light/main.css"
    />
    <script src="https://js.arcgis.com/4.29/"></script>

    <style>
      html,
      body,
      #viewDiv {
        padding: 0;
        margin: 0;
        height: 100%;
        width: 100%;
      }
    </style>

    <script>
      require(["esri/Map", "esri/views/MapView"], (Map, MapView) => {
        deck.loadArcGISModules().then((arcGIS) => {
          const layer = new arcGIS.DeckLayer();

          const geoJsonLayer = new deck.GeoJsonLayer({
            id: "GeoJsonLayer",
            data: "https://raw.githubusercontent.com/visgl/deck.gl-data/master/website/bart.geo.json",

            extruded: true,
            filled: true,
            getElevation: 30,
            getFillColor: [160, 160, 180, 200],
            getLineColor: (f) => {
              const hex = f.properties.color;
              // convert to RGB
              return hex
                ? hex.match(/[0-9a-f]{2}/g).map((x) => parseInt(x, 16))
                : [0, 0, 0];
            },
            getLineWidth: 600,
            getPointRadius: 4,
            getText: (f) => f.properties.name,
            getTextSize: 12,
            lineWidthMinPixels: 2,
            pointRadiusUnits: "pixels",
            pointType: "circle+text",
            stroked: false,
            pickable: true,
          });

          layer.deck.layers = [geoJsonLayer];

          layer.deck.getCursor = ({ isHovering }) => {
            if (isHovering) return "pointer";
            return "default";
          };
          layer.deck.getTooltip = ({ object }) => {
            // deck.gl@9.0.14 @deck.gl/arcgis@9.0.14
            console.log("deck.getTooltip", object);
            return object?.properties?.name;
          };

          const map = new Map({
            basemap: "dark-gray-vector",
            layers: [layer],
          });

          const mapView = new MapView({
            container: "viewDiv",
            map,
            center: [-122.4, 37.74],
            zoom: 11,
          });
        });
      });
    </script>
  </head>

  <body>
    <div id="viewDiv"></div>
  </body>
</html>

@gdnwr gdnwr changed the title [Bug]Using @deck.gl/arcgis@9.0.12: deck.getTooltip({object}) the parameter object is undefined. [Bug]Using @deck.gl/arcgis@9.0.14: deck.getTooltip({object}) the parameter object is undefined. May 8, 2024
@gdnwr
Copy link
Author

gdnwr commented May 10, 2024

@Pessimistress
Hello, the test code has been provided. Could you please help with it when you have time?
https://codesandbox.io/p/sandbox/arcgis-deck-forked-9m52cr?file=%2Findex.html

@Pessimistress
Copy link
Collaborator

I can reproduce this on a Windows machine with NVIDIA GTX 1060. Firefox works as expected. All browsers on Mac work as expected.

@gdnwr
Copy link
Author

gdnwr commented May 21, 2024

@Pessimistress May I ask when this issue is scheduled to be fixed?

@Pessimistress
Copy link
Collaborator

I do not know what is causing it. If you can provide more information (like your GPU) it may help us narrow it down.

@gdnwr
Copy link
Author

gdnwr commented May 22, 2024

Hardware information: AMD Ryzen 7 5800H with Radeon Graphics. no dedicated graphics card.
OS: windows11.
Chrome125: The issue with Chrome is reproducible.
Firefox126: Firefox works normally during initialization, but after dragging the map, it malfunctions.

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

No branches or pull requests

2 participants