How to use the mapv.utilDataRangeIntensity function in mapv

To help you get started, we’ve selected a few mapv 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 huiyan-fe / react-bmap / src / components / thick-ray.js View on Github external
this.props.data.forEach((item, index) => {
                var fromCenter = item.from.point || utilCityCenter.getCenterByCityName(item.from.city);
                var toCenter = item.to.point || utilCityCenter.getCenterByCityName(item.to.city);
                var curve = utilCurve.getPoints([fromCenter, toCenter]);

                if (this.props.coordType === 'bd09mc') {
                    points.push(projection.pointToLngLat(new BMap.Pixel(fromCenter.lng, fromCenter.lat)));
                    points.push(projection.pointToLngLat(new BMap.Pixel(toCenter.lng, toCenter.lat)));
                } else {
                    points.push(fromCenter);
                    points.push(toCenter);
                }

                var intensity = new utilDataRangeIntensity({
                    maxSize: 10,
                    minSize: 1,
                    min: this.props.min || 0,
                    max: this.props.max || 1000
                });
                var lineWidth = intensity.getSize(item.count)
                
                lineData.push({
                    strokeStyle: item.color,
                    geometry: {
                        type: 'LineString',
                        coordinates: isCurve ? curve : [[fromCenter.lng,fromCenter.lat],[toCenter.lng, toCenter.lat]]
                    },
                    count: item.count,
                    lineWidth: lineWidth
                });