Search code examples
cssgoogle-maps-static-api

Can I use a Google static map as a background?


I'm trying to apply a Google static map as a background for a div element. Is this possible? I'm using the image-background CSS property at the moment.


Solution

  • You can simply save the image by navigating to the URL of your static map and use it as a background like any other image.

    .map-div {
        background-image:url('static-map.png');
    }
    

    The maximum resolution it can be is 640x640, which may or may not be sufficient, however you can use a scale value of 2 to get a 1280x1280 image.