Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug (?) when getting google maps that are not square #17

Closed
jonnybaik opened this issue May 27, 2013 · 4 comments
Closed

Bug (?) when getting google maps that are not square #17

jonnybaik opened this issue May 27, 2013 · 4 comments

Comments

@jonnybaik
Copy link

It seems that the function get_googlemap does not like it when I request a rectangular map size.

I have R 3.0.0 running on Ubuntu 12.04 and ggmap version 2.3. When I run the following code, the map is not what I expect.

map_center <- c(lon=-123.1119, lat=49.2505)
test <- get_googlemap(center=map_center, zoom=3, maptype="satellite", size=c(640,320))
ggmap(test)

When I change the size parameter to any square dimensions, I get a nice map

@jonnybaik
Copy link
Author

It seems that the temporary file, ggmapTemp.png, is correct, but the plot displayed by ggmap is distorted.

@krlmlr
Copy link

krlmlr commented Oct 9, 2014

Does this problem still persist?

@dannguyen
Copy link
Contributor

@krlmlr Yep, I'm still getting this error as of ggmap_2.5.2 and ggplot2_1.0.1

Square

goog_map <- get_googlemap(size = c(200,200), zoom = 6, scale = 2)    
ggmap(goog_map, extent = 'panel')

Resulting URL: http://maps.googleapis.com/maps/api/staticmap?center=29.763284,-95.363271&zoom=6&size=200x200&scale=2&maptype=terrain&sensor=false

image

200x100

goog_map <- get_googlemap(size = c(200,150), zoom = 6, scale = 2)    
ggmap(goog_map, extent = 'panel')

Result URL:

http://maps.googleapis.com/maps/api/staticmap?center=29.763284,-95.363271&zoom=6&size=200x150&scale=2&maptype=terrain&sensor=false

Result PNG:

image

What PNG should actually look like:

image

@dkahle dkahle closed this as completed in 9f876d3 Sep 5, 2015
@dkahle
Copy link
Owner

dkahle commented Sep 5, 2015

Got it, thanks for the bump!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants