summaryrefslogtreecommitdiff
path: root/platform/ios/app
diff options
context:
space:
mode:
Diffstat (limited to 'platform/ios/app')
-rw-r--r--platform/ios/app/MBXViewController.m24
1 files changed, 21 insertions, 3 deletions
diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m
index 756f4d5516..29c5c65012 100644
--- a/platform/ios/app/MBXViewController.m
+++ b/platform/ios/app/MBXViewController.m
@@ -1317,15 +1317,33 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) {
{
MGLCoordinateQuad coordinateQuad = {
{ 46.437, -80.425 },
- { 46.437, -71.516 },
+ { 37.936, -80.425 },
{ 37.936, -71.516 },
- { 37.936, -80.425 } };
+ { 46.437, -71.516 } };
+
+ MGLImageSource *imageSource = [[MGLImageSource alloc] initWithIdentifier:@"style-image-source-id" coordinateQuad:coordinateQuad URL:[NSURL URLWithString:@"https://www.mapbox.com/mapbox-gl-js/assets/radar0.gif"]];
- MGLImageSource *imageSource = [[MGLImageSource alloc] initWithIdentifier:@"style-image-source-id" coordinates:coordinateQuad imageURL:[NSURL URLWithString:@"https://www.mapbox.com/mapbox-gl-js/assets/radar.gif"]];
[self.mapView.style addSource:imageSource];
MGLRasterStyleLayer *rasterLayer = [[MGLRasterStyleLayer alloc] initWithIdentifier:@"style-raster-image-layer-id" source:imageSource];
[self.mapView.style addLayer:rasterLayer];
+
+ [NSTimer scheduledTimerWithTimeInterval:1.0
+ target:self
+ selector:@selector(updateAnimatedImageSource:)
+ userInfo:imageSource
+ repeats:YES];
+}
+
+
+- (void)updateAnimatedImageSource:(NSTimer *)timer {
+ static int radarSuffix = 0;
+ MGLImageSource *imageSource = (MGLImageSource *)timer.userInfo;
+ NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://www.mapbox.com/mapbox-gl-js/assets/radar%d.gif", radarSuffix++]];
+ [imageSource setValue:url forKey:@"URL"];
+ if (radarSuffix > 3) {
+ radarSuffix = 0;
+ }
}
-(void)styleCountryLabelsLanguage