{"action":"closed","issue":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-cocoa/issues/78","labels_url":"https://api.github.com/repos/mapbox/mapbox-gl-cocoa/issues/78/labels{/name}","comments_url":"https://api.github.com/repos/mapbox/mapbox-gl-cocoa/issues/78/comments","events_url":"https://api.github.com/repos/mapbox/mapbox-gl-cocoa/issues/78/events","html_url":"https://github.com/mapbox/mapbox-gl-cocoa/issues/78","id":54498190,"number":78,"title":"disappearing style","user":{"login":"bvjustin","id":2054220,"avatar_url":"https://avatars.githubusercontent.com/u/2054220?v=3","gravatar_id":"","url":"https://api.github.com/users/bvjustin","html_url":"https://github.com/bvjustin","followers_url":"https://api.github.com/users/bvjustin/followers","following_url":"https://api.github.com/users/bvjustin/following{/other_user}","gists_url":"https://api.github.com/users/bvjustin/gists{/gist_id}","starred_url":"https://api.github.com/users/bvjustin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bvjustin/subscriptions","organizations_url":"https://api.github.com/users/bvjustin/orgs","repos_url":"https://api.github.com/users/bvjustin/repos","events_url":"https://api.github.com/users/bvjustin/events{/privacy}","received_events_url":"https://api.github.com/users/bvjustin/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mapbox/mapbox-gl-cocoa/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-01-15T20:14:54Z","updated_at":"2015-02-10T19:06:17Z","closed_at":"2015-02-10T19:06:17Z","body":"Noticed the following issue:\r\n\r\nWhen an MGLMapView is initialized with a JSON string, then the Map has no styleURL set.\r\n\r\nWhen the iOS app goes to the background, Map::stop() gets called, which calls the Map's asyncTerminate block, which clears the Map's style object.\r\n\r\nThen, when bringing the app back to the foreground, Map::start() is called, which results in Map::prepare() getting called.  \r\n\r\nMap::prepare() attempts to load the style (because the style was reset in the asyncTerminate block when backgrounded).  Because in this case the map was initialized with a JSON string (rather than read from a URL) this fails to load a style.  On screen the map appears normal until the first interaction with it, and then the screen goes black.\r\n\r\nNot an issue if you're only dealing with styles read from a bundled style, only when initializing a map from a JSON string."}}