问题
In url requests for Google Maps, the center of the domain has to be defined:
url = "http://maps.googleapis.com/maps/api/staticmap?center=10.027489,51.229248&size=650x650&zoom=14&sensor=false"
Even when I play with zoom or size, I don't get the exact map that I want. Is there a way to define the southwest and northeast corners of the domain ? Or any other way to better define a domain ?
回答1:
Yes, you can use the visible
parameter to specify the 2 opposite corners of a rectangular region, and the map will automatically adjust center and zoom to fit that region.
See Implicit Positioning of the Map (there's an example there).
来源:https://stackoverflow.com/questions/39352477/google-maps-url-parameters