Skip to content

Commit 45bcbe6

Browse files
committed
Merge branch 'leaflet-aio' of https://github.com/plotly/dash-cytoscape into leaflet-aio
2 parents 0249069 + ec1a55d commit 45bcbe6

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/lib/cyleaflet_clientside.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@ var conversion_factor = 20037508.34;
1616
// We also flip the sign of the y-value to match Cytoscape's coordinate system
1717
function lonLatToXY(lon, lat) {
1818
var x = lon * conversion_factor / 180;
19-
var y = Math.log(Math.tan((90 + lat) * Math.PI / 360)) / (Math.PI / 180);
20-
y = y * conversion_factor / 180;
21-
return [x, -y];
19+
var y = -Math.log(Math.tan((90 + lat) * Math.PI / 360)) * conversion_factor / Math.PI;
20+
return [x, y];
2221
}
2322

2423
// Convert EPSG:3857 to EPSG:4326

0 commit comments

Comments
 (0)