(2 intermediate revisions by 2 users not shown) | |||
Line 134: | Line 134: | ||
//Setup path for globe | //Setup path for globe | ||
var projection = d3.geo.azimuthal().mode("orthographic").translate([width / 2, height / 2]); | var projection = d3.geo.azimuthal().mode("orthographic").translate([width / 2, height / 2]); | ||
− | var scale0 = projection.scale() | + | var scale0 = projection.scale(); |
var path = d3.geo.path().projection(projection) | var path = d3.geo.path().projection(projection) | ||
var arcPath = d3.geo.path().projection(projection) | var arcPath = d3.geo.path().projection(projection) | ||
Line 142: | Line 142: | ||
start = [49.4057072, 8.6135741] | start = [49.4057072, 8.6135741] | ||
//Setup zoom behavior | //Setup zoom behavior | ||
− | var zoom = d3.behavior.zoom( | + | var zoom = d3.behavior.zoom(true) |
.translate(projection.origin()) | .translate(projection.origin()) | ||
− | .scale(projection.scale()) | + | .scale(projection.scale()-50) |
.scaleExtent([200, 200]) | .scaleExtent([200, 200]) | ||
.on("zoom", move); | .on("zoom", move); | ||
Line 150: | Line 150: | ||
var circle = d3.geo.greatCircle(); | var circle = d3.geo.greatCircle(); | ||
− | + | //var lineTooltip = d3.select('#show'); | |
var svg = d3.select("#globe") | var svg = d3.select("#globe") | ||
Line 202: | Line 202: | ||
return arcPath(circle.clip(d)); | return arcPath(circle.clip(d)); | ||
}).on("mouseover", function(d) { | }).on("mouseover", function(d) { | ||
− | lineTooltip.html( | + | lineTooltip.html(d.properties.name); |
}); | }); | ||
Line 213: | Line 213: | ||
return devPath(circle.clip(d)); | return devPath(circle.clip(d)); | ||
}).on("mouseover", function(d) { | }).on("mouseover", function(d) { | ||
− | lineTooltip.html( | + | lineTooltip.html(d.properties.name); |
}); | }); | ||
Latest revision as of 12:06, 1 November 2017