commenting out zoom workaround. doesn't solve the Chrome/WebKit bug for transforming mouse coordinates and is not useful for the map view (it was effective for transform in the ring view display. But still not for mouse)
diff --git a/web/ons-demo/js/app.js b/web/ons-demo/js/app.js
index 2689b43..f7ff533 100644
--- a/web/ons-demo/js/app.js
+++ b/web/ons-demo/js/app.js
@@ -36,17 +36,25 @@
});
}
+// workaround for another Chrome v25 bug
+// viewbox transform stuff doesn't work in combination with browser zoom
+// also works in Chrome v27
+function zoomWorkaround() {
+ var zoom = window.document.body.clientWidth/window.document.width;
+ console.log(zoom);
+ // workaround does not seem to be effective for transforming mouse coordinates
+ // map display does not use the transform stuff, so commenting out
+// d3.select('#svg-container').style('zoom', zoom);
+}
+
+d3.select(window).on('resize', zoomWorkaround);
+
appInit(function () {
// workaround for Chrome v25 bug
// if executed immediately, the view box transform logic doesn't work properly
// fixed in Chrome v27
setTimeout(function () {
-
- // workaround for another Chrome v25 bug
- // viewbox transform stuff doesn't work in combination with browser zoom
- // also works in Chrome v27
- d3.select('#svg-container').style('zoom', window.document.body.clientWidth/window.document.width);
-
+ zoomWorkaround();
sync();
}, 100);
});