From b593541ba1ac34332012738abd03ab3909a95dfd Mon Sep 17 00:00:00 2001 From: rsudekum Date: Wed, 29 Jul 2015 09:54:23 -0700 Subject: [PATCH] cleanup example --- RCTMapboxGL/RCTMapboxGL.m | 3 +-- example.js | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/RCTMapboxGL/RCTMapboxGL.m b/RCTMapboxGL/RCTMapboxGL.m index 3ab072b..0000662 100644 --- a/RCTMapboxGL/RCTMapboxGL.m +++ b/RCTMapboxGL/RCTMapboxGL.m @@ -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)]; diff --git a/example.js b/example.js index c76c7d9..cd88709 100644 --- a/example.js +++ b/example.js @@ -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' }] }; },