I need to get a map image in order to save it into a file, I know that there is a API to load static maps trough an url (REST API), but the problem is that it's very limited and it's not usefull for what I'm doing, because I need to get an image of a map that contains a large number of objects (markers, shapes, bubbles,etc) and with the REST API I can't do this.

On the other hand, I know that the map is an image, so I've tried to render the content of the DOM and painted in a canvas in order to convert it's content to an image, but It doesn´t work because the images of the map are in the server, not in the client.

Does somebody know how can I solve this?