Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
});