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

Maps Pins do not display when PM Nav Bar is enabled #39

Open
serialbandicoot opened this issue Jul 22, 2016 · 3 comments
Open

Maps Pins do not display when PM Nav Bar is enabled #39

serialbandicoot opened this issue Jul 22, 2016 · 3 comments

Comments

@serialbandicoot
Copy link

This is the weirdest issue I've seen with PM::MapScreen and how it interacts with the nav bar.

class Home < PM::Screen
  title 'Map Screen'
  nav_bar true

  def on_load
    map_view = MyMapScreen.new
    rmq.add_subview(map_view.view).style do |st|
      st.frame = {t: 100, w: device.width, h: 200}
    end
  end
end

In the MyMapScreen the annotations have been added and the pins setup correctly. However they don't display!

When I remove the nav_bar true, hey presto the pins appear!

I've tried all sorts of ways to fix this, manually adding a nav_bar:

UINavigationController.alloc.initWithRootViewController(self)
nav = self.navigationController.navigationBar
nav.frame = CGRectMake(0, 0, device.width, 70)

Or

navigation = UINavigationBar.alloc.initWithFrame(CGRectMake(0, 0, device.width, 70)) Anyway I've ended up going with the following and ditching PM Maps.

map_view = MKMapView.alloc.init
map_view.delegate = self
map_view.frame = CGRectMake(5, 80, device.width - 10, 200)
region = MKCoordinateRegionMake(CLLocationCoordinate2D.new(50.85, 4.35), MKCoordinateSpanMake(8, 8))
map_view.setRegion(region)
Beer::All.each { |beer| map_view.addAnnotation(beer) } #lifted from Samples
rmq.add_subview(map_view)

I'm not sure if anyone has had this issue, or similar, if so pls let me know, it would be nice to use the awesome map library.

@jamonholmgren
Copy link
Member

@serialbandicoot Did you get this figured out? Sorry about the non-response on this.

@serialbandicoot
Copy link
Author

Hi @jamonholmgren - sadly not. I had a really good go figuring out the loading order for the nav_bar to see if it was masking something. However time got the better of me.

@jamonholmgren
Copy link
Member

Gotcha @serialbandicoot. Maybe someone else will run into the same thing so I'll leave this open.

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

2 participants