Fix mapbox radius calculations being off when changing latitude (#824)

This commit is contained in:
George Ke 2016-07-28 11:50:39 -07:00 committed by Maxime Beauchemin
parent 88726773f1
commit f9427b9bfb
1 changed files with 3 additions and 2 deletions

View File

@ -137,12 +137,13 @@ class ScatterPlotGlowOverlay extends ScatterPlotOverlay {
let pointLabel;
if (radiusProperty !== null) {
const pointLatitude = props.lngLatAccessor(location)[1];
if (props.pointRadiusUnit === 'Kilometers') {
pointLabel = d3.round(pointRadius, 2) + 'km';
pointRadius = kmToPixels(pointRadius, props.latitude, props.zoom);
pointRadius = kmToPixels(pointRadius, pointLatitude, props.zoom);
} else if (props.pointRadiusUnit === 'Miles') {
pointLabel = d3.round(pointRadius, 2) + 'mi';
pointRadius = kmToPixels(pointRadius * MILES_PER_KM, props.latitude, props.zoom);
pointRadius = kmToPixels(pointRadius * MILES_PER_KM, pointLatitude, props.zoom);
}
}