geopoints.js 943 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. function displayGeopoints(scope, path) {
  2. /*
  3. scope.g.selectAll("circles.points")
  4. .data(points)
  5. .enter()
  6. .append("circle")
  7. .attr("r", scope.panel.display.geopoints.pointSize)
  8. .attr("opacity", scope.panel.display.geopoints.pointAlpha)
  9. .attr("transform", function (d) {
  10. return "translate(" + d[0] + "," + d[1] + ")";
  11. });
  12. */
  13. var points = []
  14. if (scope.panel.display.bullseye.enabled) {
  15. points = scope.points;
  16. }
  17. var circle = d3.geo.circle();
  18. var degrees = 180 / Math.PI
  19. var geopoints = scope.g.selectAll("geopoints")
  20. .data(points);
  21. geopoints.enter().append("path")
  22. .datum(function(d) {
  23. return circle.origin([d[0], d[1]]).angle(scope.panel.display.geopoints.pointSize / 6371 * degrees)();
  24. })
  25. .attr("d", path)
  26. .attr("class", "geopoint");
  27. geopoints.exit().remove();
  28. }