Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Annotations not shown when Internet connection is down #3817

Closed

Description

@ferrarop

In iOS, if I kill the app, disable Internet connection, and reopen the app, the annotations are not shown anymore.
The map is shown (at least the portion that is cached), but the annotations are not.
Everything works fine with Internet connection.

Minimal Working Example:

override func viewDidLoad() {
    super.viewDidLoad()

    mapView = MGLMapView(frame: view.bounds)
    mapView.autoresizingMask = [.FlexibleWidth, .FlexibleHeight]

    let center = CLLocationCoordinate2D(latitude: 38.894368, longitude: -77.036487)
    mapView.setCenterCoordinate(center, zoomLevel: 15, animated: false)

    view.addSubview(mapView)

    let annotation = MGLPointAnnotation()
    annotation.coordinate = center
    mapView.addAnnotation(annotation)    
} 

I also tried with a custom image (stored locally): the function "mapView(mapView: MGLMapView, imageForAnnotation annotation: MGLAnnotation)" is called correctly (if I set self as the mapView delegate), but the annotation is not shown.

Activity

  1. added
    iOS
    on Feb 4, 2016
  2. jfirebaugh commented on Feb 12, 2016

    @jfirebaugh
    Contributor

    SymbolLayer needs to pass its own SpriteAtlas into needsDependencies, so that needsDependencies checks the annotation sprite store for loaded state rather than the style sprite store. This requires rejiggering SpriteStore and SpriteAtlas types a bit. (I continue to think those two should be merged.)

  3. added and removed
    iOS
    on Feb 12, 2016
  4. changed the title [-][ios] Annotations not shown when Internet connection is down[/-] [+]Annotations not shown when Internet connection is down[/+] on Feb 12, 2016
  5. jfirebaugh commented on Feb 12, 2016

    @jfirebaugh
    Contributor

    Updated title / tags to reflect that this bug is not iOS specific.

  6. ferrarop commented on Feb 12, 2016

    @ferrarop
    Author

    I've just tried installing version 3.1.0 on iOS, and annotations (with local images) seem to show up fine for me, even if Internet connection is down.
    I haven't tested it extensively, I just confirmed they show up in a minimal working example like the one I posted.

  7. self-assigned this
    on Sep 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions