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

Commit

Permalink
prohibit changing the style while the map is rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
kkaefer committed Feb 16, 2015
1 parent 9692f45 commit 053d743
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/mbgl/map/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,10 @@ void Map::loadStyleURL() {


void Map::setStyleJSON(std::string newStyleJSON, const std::string &base) {
// TODO: figure out what thread this may be called from
// TODO: Make threadsafe.
if (active && inUIThread()) {
throw util::Exception("Style cannot be changed while the Map is rendering");
}

styleJSON.swap(newStyleJSON);
sprite.reset();
if (!style) {
Expand Down

0 comments on commit 053d743

Please sign in to comment.