Problem displaying feature layer in a scene view

1747
2
Jump to solution
01-19-2017 12:13 PM
DanielSchatt
New Contributor III

hi, I have a very simple code, just trying to display a feature layer in a scene view, using an offset in the elevationInfo property of the feature layer.  But I'm getting a strange error:

Uncaught (in promise) TypeError: cannot read property 'y' of null

No idea what this is, code is below.  Appreciate any help, thanks!

  <script>
    require([
      "esri/Map",
      "esri/views/SceneView",
      "esri/layers/FeatureLayer",
      "dojo/domReady!"
    ], function(Map, SceneView, FeatureLayer) {

      var map = new Map({
        basemap: "streets",
        ground: "world-elevation"
      });

      var view = new SceneView({
        container: "viewDiv",
        map: map,
        zoom: 13,
        center: [-76.34, 37.12],
        viewingMode: "local"
      });
      
      var featureLayer = new FeatureLayer({
        url: "http://cmap2.vims.edu/arcgis/rest/services/Test_3D/MapServer/0",
        elevationInfo: {
          mode: "absolute-height",
          offset: 20
        }          
      });

      map.add(featureLayer);

    });
  </script>‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
0 Kudos
1 Solution

Accepted Solutions
FC_Basson
MVP Regular Contributor

The issue is not with your code - I believe your feature geometry that you are trying to load as a FeatureLayer is too complex for the SceneView.

View solution in original post

2 Replies
FC_Basson
MVP Regular Contributor

The issue is not with your code - I believe your feature geometry that you are trying to load as a FeatureLayer is too complex for the SceneView.

DanielSchatt
New Contributor III

thanks FC, appreciate your help!

0 Kudos