Commit e0a0013c by Zachary Tong

Fix clipping issues with bullseye on sphere

parent 9a91a494
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* Renders bullseyes as geo-json poly gon entities * Renders bullseyes as geo-json poly gon entities
* Allows for them to clip on spheres correctly * Allows for them to clip on spheres correctly
*/ */
function displayBullseye(scope, dr, path) { function displayBullseye(scope, dr) {
var degrees = 180 / Math.PI var degrees = 180 / Math.PI
var circle = d3.geo.circle(); var circle = d3.geo.circle();
...@@ -10,7 +10,7 @@ function displayBullseye(scope, dr, path) { ...@@ -10,7 +10,7 @@ function displayBullseye(scope, dr, path) {
if (scope.panel.display.bullseye.enabled) { if (scope.panel.display.bullseye.enabled) {
data = [ data = [
{lat: parseFloat(scope.panel.display.bullseye.coord.lat), lon: parseFloat(scope.panel.display.bullseye.coord.lon)} circle.origin(parseFloat(scope.panel.display.bullseye.coord.lat), parseFloat(scope.panel.display.bullseye.coord.lon)).angle(1000 / 6371 * degrees)()
]; ];
} }
...@@ -18,10 +18,8 @@ function displayBullseye(scope, dr, path) { ...@@ -18,10 +18,8 @@ function displayBullseye(scope, dr, path) {
.data(data); .data(data);
arcs.enter().append("path") arcs.enter().append("path")
.datum(function(d) {
return circle.origin([d.lon, d.lat]).angle(1000 / 6371 * degrees)(); .attr("d", dr.path)
})
.attr("d", path)
.attr("class", "arc"); .attr("class", "arc");
arcs.exit().remove(); arcs.exit().remove();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment