So after more research I write this code:

function(datamap) {'.datamap').call(
            .scaleExtent([0.7, 6])
            .on('zoom', function() {
              datamap.svg.selectAll('g').attr('transform', d3.event.transform);

It runs after the chart has loaded, and fortunately it works. For some reason when you call the zoom() function on the datamap.svg it cause an error while datamap.svg and'.datamap') creates a similar array but create a selection. If anyone know why it doesn't work the other way please explain it.

Related Query

More Query from same tag