From 0a919186222712883b486aec4d4d16b29969b35a Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Mon, 10 Jun 2013 17:42:31 -0700 Subject: [PATCH] Support TMS-flipped Y coordinate with {ty} replacement. --- js/id/renderer/background_source.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/js/id/renderer/background_source.js b/js/id/renderer/background_source.js index ef17fe5da..778e0c5cc 100644 --- a/js/id/renderer/background_source.js +++ b/js/id/renderer/background_source.js @@ -19,6 +19,8 @@ iD.BackgroundSource.template = function(data) { .replace('{u}', u) .replace('{x}', coord[0]) .replace('{y}', coord[1]) + // TMS-flipped y coordinate + .replace('{ty}', Math.pow(2, coord[2]) - coord[1] - 1) .replace('{z}', coord[2]) // JOSM style .replace('{zoom}', coord[2])