mirror of
https://github.com/apache/superset.git
synced 2024-09-12 16:49:40 -04:00
Fix mapbox radius calculations being off when changing latitude (#824)
This commit is contained in:
parent
88726773f1
commit
f9427b9bfb
@ -137,12 +137,13 @@ class ScatterPlotGlowOverlay extends ScatterPlotOverlay {
|
|||||||
let pointLabel;
|
let pointLabel;
|
||||||
|
|
||||||
if (radiusProperty !== null) {
|
if (radiusProperty !== null) {
|
||||||
|
const pointLatitude = props.lngLatAccessor(location)[1];
|
||||||
if (props.pointRadiusUnit === 'Kilometers') {
|
if (props.pointRadiusUnit === 'Kilometers') {
|
||||||
pointLabel = d3.round(pointRadius, 2) + 'km';
|
pointLabel = d3.round(pointRadius, 2) + 'km';
|
||||||
pointRadius = kmToPixels(pointRadius, props.latitude, props.zoom);
|
pointRadius = kmToPixels(pointRadius, pointLatitude, props.zoom);
|
||||||
} else if (props.pointRadiusUnit === 'Miles') {
|
} else if (props.pointRadiusUnit === 'Miles') {
|
||||||
pointLabel = d3.round(pointRadius, 2) + 'mi';
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user