I have a D3.js Datamaps.js map with pin markers, that I've been trying to implement zooming for.
http://jsbin.com/xoferi/edit?html,output
The image pin markers are 20x20 and the point of the pin (at x+10,y+20) is over the latitude/longitude spot selected.
I'm having issues when zooming the map, with the images drifting from their relative position. For example: take a look a the Iceland pin. As you zoom in it drifts up and to the left.
How can I keep the pins the same size, and in the same relative position while zooming and click-dragging the map?
I've looked for other examples and I'm just not sure what I'm missing. Maybe the viewport size needs to be added to the calculation soemhow. Or maybe the origin of the pin markers needs to be changed from the default. I'm just not sure.