Started to use eval to put the marker in place… potentially insecure, but the only way to have the correct data in the function it seems.