I create a map in a div with 'display: none'. With google maps v2 I could set the 'size' parameter to the size of the div once shown, but this 'size' option disappeared in v3 of the API.
How can I do that?
To change the map scale units used on the Google Maps desktop website on your Windows 10 PC or Mac, click the scale bar in the bottom-right corner. Selecting the scale bar will switch to the other measurements, allowing you to quickly view the map scale in miles, kilometers, or relevant smaller units.
You modify the map type in use by the Map by setting its mapTypeId property, either within the constructor via setting its Map options object, or by calling the map's setMapTypeId() method.
Create a map with the Google Maps API.Google Maps Platform gives you the ability to create a truly custom map that works exactly how you want it to.
Static Maps images can be returned in any size up to 640 x 640 pixels. If you need images with sizes larger than 640 x 640 pixels (or 640 x 640640 x 640 pixels with a scale value of 2), follow these steps.
Change the size of the div using any method you want, and then call google.maps.event.trigger(map, 'resize')
. A related question is here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With