Skip to content

Commit

Permalink
Add explicit 'clear' method to TGMapData
Browse files Browse the repository at this point in the history
  • Loading branch information
matteblair committed Jan 2, 2020
1 parent 4c5136a commit 895e9e1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions platforms/ios/framework/src/TGMapData.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (void)setGeoJson:(NSString *)data;

/**
Clears the contents of this map data.
*/
- (void)clear;

/**
Permanently removes this map data from the map view.
Expand Down
10 changes: 10 additions & 0 deletions platforms/ios/framework/src/TGMapData.mm
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,16 @@ - (void)setGeoJson:(NSString *)data
dataSource->generateTiles();
}

- (void)clear
{
if (!self.map) {
return;
}

dataSource->clearFeatures();
dataSource->generateTiles();
}

- (BOOL)remove
{
if (!self.map) {
Expand Down

0 comments on commit 895e9e1

Please sign in to comment.