mirror of
https://github.com/FoggedLens/iD.git
synced 2026-04-29 23:17:53 +02:00
Cache path
This commit is contained in:
+2
-2
@@ -1,4 +1,5 @@
|
||||
iD.svg.Labels = function(projection, context) {
|
||||
var path = d3.geo.path().projection(projection);
|
||||
|
||||
// Replace with dict and iterate over entities tags instead?
|
||||
var label_stack = [
|
||||
@@ -368,8 +369,7 @@ iD.svg.Labels = function(projection, context) {
|
||||
}
|
||||
|
||||
function getAreaLabel(entity, width, height) {
|
||||
var path = d3.geo.path().projection(projection),
|
||||
centroid = path.centroid(entity.asGeoJSON(graph, true)),
|
||||
var centroid = path.centroid(entity.asGeoJSON(graph, true)),
|
||||
extent = entity.extent(graph),
|
||||
entitywidth = projection(extent[1])[0] - projection(extent[0])[0],
|
||||
rect;
|
||||
|
||||
Reference in New Issue
Block a user