lundi 23 février 2015

Firefox and D3: Zoom + Pan bug


I have a simple code here some map with zoom+pan effect. It work fine on Opera, Chrome even IE. But Firefox do not show it.-


If you open "Inspector" panel, you'll see has same values (translation, scale, path, d**) on Firefox than the other, but don't render properly.


Obviously is Firefox's bug cause on other browser works nice and D3 generate the code correctly.-


And here same map without zoom+pan effects, Firefox show it nice. I think it's a bitwise operator (*) problem, some google do not gave me any reference.


Any idea what's going wrong?




(*) code take it from Mike's site: http://ift.tt/1LxlMA1 He use:



var projection = d3.geo.mercator()
.scale((1 << 12) / 2 / Math.PI)
.translate([width / 2, height / 2]);

and

var zoom = d3.behavior.zoom()
.scale(projection.scale() * 2 * Math.PI)
.scaleExtent([1 << 11, 1 << 14])
.translate([width - center[0], height - center[1]])
.on("zoom", zoomed);




(**)



<svg width="600px" height="500px" transform="translate(5579.288888888889,-2536.2020481280824)scale(32768)"><path class="county" d="M239.07661387245844,54.......




Aucun commentaire:

Enregistrer un commentaire