diff --git a/platforms/ios/framework/src/TGMapData.h b/platforms/ios/framework/src/TGMapData.h index 4b6b28e1b2..b02b80c6c3 100644 --- a/platforms/ios/framework/src/TGMapData.h +++ b/platforms/ios/framework/src/TGMapData.h @@ -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. diff --git a/platforms/ios/framework/src/TGMapData.mm b/platforms/ios/framework/src/TGMapData.mm index 6e19a4bed3..cb85f0d70c 100644 --- a/platforms/ios/framework/src/TGMapData.mm +++ b/platforms/ios/framework/src/TGMapData.mm @@ -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) {