Skip to content
This repository has been archived by the owner on May 24, 2021. It is now read-only.

map of marker results is not centered on some mobile devices #48

Open
JackDougherty opened this issue Mar 12, 2015 · 4 comments
Open

map of marker results is not centered on some mobile devices #48

JackDougherty opened this issue Mar 12, 2015 · 4 comments
Labels

Comments

@JackDougherty
Copy link

Derek
Not sure if this is an issue (or my user error!) so feel free to close it out if I'm mistaken.

Your template works wonderfully on desktops/laptops, but I'm having problems with viewing map results in some mobile devices.

When using your current template and searching for Chicago zip code 60606 on some mobile devices (such as iPhone 5), the results are not centered, and therefore not immediately visible on the small screen. See screenshot
templateresults-iphone5

However, map results are centered when I use the Chrome for desktop developer tools emulator for iPhone 5, as shown below
template-chromeemulator

Also, results are centered on larger mobile devices, such as Nexus 7 tablet.

So. . . is this an issue, or not?
thanks
Jack

@ffflabs
Copy link
Contributor

ffflabs commented Mar 12, 2015

There is a relation between zoom level and display resolution. Current default zoom is suggested for desktop screens, but mobile screens should default to a lower zoom.

Perhaps instead of setting center and zoom, the constructor should use the fitBounds method.

  • Pros for any resolution the map would pick the best zoom it can offer to fit the bounds.
  • Cons it's much more intuitive to pick center and zoom instead of [SE, NW]

Perhaps the bounds property should override the center and zoom only when it's defined?

@machewgc
Copy link

Did you ever find a solution to this problem?

@gontxillo
Copy link

Good afternoon,

  I tried to follow indications als installation file, but I do not jump the counter results nor logically me the sample.
   I downloaded the example of chicago website where a button on the shows you cercanos.Pero sites appears no way to put it into production.

Could you help me? I have found that I While fusiontable by location but not I'm doing wrong and this is my salvation!

Thank you very much and excuse my English

@scottcarver
Copy link

In iOS as a user scrolls down from the very top of the page, the URL bar morphs from it's normal state (with address bar) into a compact view. As this happens the viewport size is changing and firing a resize event in maps_lib.js google.maps.event.addDomListener(window, 'resize') which recenters the map. Unfortunately the map's centerpoint does not update when you do a search. One could could potentially modify maps_lib.js to update the centerpoint to correct the behavior. I've opted to remove the event listener entirely because it was an enhancement anyway, not critical behavior.

You'll notice that this will happen in desktop browsers as well should you resize the viewport. It's just a more in your face situation on iOS because you cannot avoid scrolling.

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

No branches or pull requests

6 participants