Giter Site home page Giter Site logo

Comments (4)

Pessimistress avatar Pessimistress commented on May 19, 2024 1

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.

from deck.gl.

gdnwr avatar gdnwr commented on May 19, 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/[email protected]/dist.min.js"></script>
    <script src="https://unpkg.com/@deck.gl/[email protected]/dist.min.js"></script>
    <script src="https://unpkg.com/@deck.gl/[email protected]/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 }) => {
            // [email protected] @deck.gl/[email protected]
            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>

from deck.gl.

gdnwr avatar gdnwr commented on May 19, 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

from deck.gl.

Related Issues (20)

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.