mirror of
https://github.com/status-im/react-native-mapbox-gl.git
synced 2026-08-30 20:41:08 +00:00
cleanup example
This commit is contained in:
@@ -338,12 +338,11 @@ RCT_EXPORT_MODULE();
|
||||
|
||||
UIImage *image = nil;
|
||||
if ([url hasPrefix:@"image!"]) {
|
||||
NSString* localImagePath = [url substringFromIndex:6]; //image!myImage.jpg
|
||||
NSString* localImagePath = [url substringFromIndex:6];
|
||||
image = [UIImage imageNamed:localImagePath];
|
||||
} else {
|
||||
image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:url]]];
|
||||
}
|
||||
|
||||
|
||||
UIGraphicsBeginImageContextWithOptions(imageSize, NO, 0.0);
|
||||
[image drawInRect:CGRectMake(0, 0, imageSize.width, imageSize.height)];
|
||||
|
||||
+12
-5
@@ -26,20 +26,27 @@ var Example = React.createClass({
|
||||
title: 'This is marker 1',
|
||||
subtitle: 'It has a rightCalloutAccessory too',
|
||||
rightCalloutAccessory: {
|
||||
url: 'http://png-3.findicons.com/files/icons/2799/flat_icons/256/gear.png',
|
||||
url: 'https://cldup.com/9Lp0EaBw5s.png',
|
||||
height: 25,
|
||||
width: 25
|
||||
}
|
||||
},
|
||||
annotationImage: {
|
||||
url: 'https://cldup.com/CnRLZem9k9.png',
|
||||
height: 25,
|
||||
width: 25
|
||||
},
|
||||
id: 'marker1'
|
||||
},{
|
||||
latitude: 40.714541341726175,
|
||||
longitude: -74.00579452514648,
|
||||
title: 'Important!',
|
||||
subtitle: 'Neat, this is a custon annotation image',
|
||||
subtitle: 'Neat, this is a custom annotation image',
|
||||
annotationImage: {
|
||||
url: 'https://avatars3.githubusercontent.com/u/600935?v=3&s=84',
|
||||
url: 'https://cldup.com/7NLZklp8zS.png',
|
||||
height: 25,
|
||||
width: 25
|
||||
}
|
||||
},
|
||||
id: 'marker2'
|
||||
}]
|
||||
};
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user