Select to view content in your preferred language

Polylines disappear while zooming out

584
0
07-30-2020 03:00 PM
AndrewMurdoch1
Frequent Contributor

Good Day

We have a map with thousands of small polylines and as we change the zoom level the lines appear when we zoom in and disappear when we zoom out, is there a way to prevent this functionality?  Can we have them render like markers, where zoomed out we just see one large marker?

This is our Feature Layer / Render Build code:

buildFeatureSettings(geometryType, data, colour) {

  console.log('Feature Layer Data');
  console.log(data);

  return {
    source: data,
    renderer: this.buildRenderSettings(data, colour, geometryType.toString().includes('point')),
    fields: this._fields,
    objectIdField: 'ObjectID',
    geometryType: geometryType,
    spatialReference: {
      wkid: 4326
    },
    title: this._allAssets ? data[0].attributes.assetType : data[0].attributes.layer
  };
}

/**
 * Build the rendering options for the feature layer
 */

buildRenderSettings(data, colour: string, marker = false) {
  return {
    type: 'simple',
    symbol: {
      style: marker ? 'circle' : null,
      type: marker ? 'simple-marker' : 'simple-fill',
      size: marker ? 12 : 30,
      color: _.cloneDeep(colour),
      outline: {
        width: 4,
        color: _.cloneDeep(colour),
      }
    },
  }
}

Thanks

0 Replies