How to use the react-mapbox-gl/lib-esm/context.withMap function in react-mapbox-gl

To help you get started, we’ve selected a few react-mapbox-gl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github thuanmb / react-mapbox-gl-cluster / dist / components / ReactMapboxGlCluster / Cluster.js View on Github external
this.mapChange();
    }
  }, {
    key: "shouldComponentUpdate",
    value: function shouldComponentUpdate(nextProps, nextState) {
      var clusterPoints = this.state.clusterPoints;
      var nextClusterPoints = nextState.clusterPoints;
      return !_.isEqual(this.props, nextProps) || !_.isEqual(clusterPoints, nextClusterPoints);
    }
  }]);

  return OverridedCluster;
}(Cluster);

OverridedCluster.displayName = "Cluster";
export default withMap(OverridedCluster);
github thuanmb / react-mapbox-gl-cluster / src / lib / components / ReactMapboxGlCluster / Cluster.jsx View on Github external
}

  shouldComponentUpdate(nextProps, nextState) {
    const { clusterPoints } = this.state;
    const { clusterPoints: nextClusterPoints } = nextState;

    return (
      !_.isEqual(this.props, nextProps) ||
      !_.isEqual(clusterPoints, nextClusterPoints)
    );
  }
}

OverridedCluster.displayName = "Cluster";

export default withMap(OverridedCluster);

react-mapbox-gl

A React binding of mapbox-gl-js

MIT
Latest version published 4 years ago

Package Health Score

59 / 100
Full package analysis