geopoints.js 863 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /**
  2. * Renders geopoints as geo-json poly gon entities
  3. * Allows for them to clip on spheres correctly
  4. */
  5. function displayGeopoints(scope, dr) {
  6. var points = [];
  7. var circle = d3.geo.circle();
  8. var degrees = 180 / Math.PI
  9. if (scope.panel.display.geopoints.enabled) {
  10. //points = dr.points;
  11. points = _.map(dr.points, function(v) {
  12. return {
  13. type: "Point",
  14. coordinates: [v[0], v[1]]
  15. };
  16. });
  17. }
  18. dr.geopoints = dr.g.selectAll("path.geopoint")
  19. .data(points);
  20. dr.geopoints.enter().append("path")
  21. /*
  22. .datum(function(d) {
  23. return circle.origin([d[0], d[1]]).angle(scope.panel.display.geopoints.pointSize / 6371 * degrees)();
  24. })
  25. */
  26. .attr("class", "geopoint")
  27. .attr("d", dr.path);
  28. dr.geopoints.exit().remove();
  29. }