Skip to content

Commit

Permalink
Expose zIndex for annotations, title for overlays
Browse files Browse the repository at this point in the history
  • Loading branch information
hansemannn committed Jul 11, 2017
1 parent 6748c00 commit 63d4f95
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 3 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ var annotation = maps.createAnnotation({
draggable: true, // Default: false
flat: true, // Default: false
opacity: 1,
zIndex: 1,
animationStyle: maps.APPEAR_ANIMATION_POP, // One of 'APPEAR_ANIMATION_NONE' (default) and 'APPEAR_ANIMATION_POP'
rotation: 30, // measured in degrees clockwise from the default position
centerOffset: {
Expand Down Expand Up @@ -406,7 +407,8 @@ var polyline = maps.createPolyline({
longitude : 144.96298
}, [-31.95285, 115.85734]],
strokeWidth : 3, // Default: 1
strokeColor : '#f00' // Default: Black (#000000)
strokeColor : '#f00' // Default: Black (#000000),
title: 'My Polyline'
});
mapView.addPolyline(polyline);
```
Expand All @@ -424,7 +426,8 @@ var polygon = maps.createPolygon({
[-33.91785, 115.82234]],
strokeWidth : 3,
fillColor : 'yellow', // Default: Blue (#0000ff)
strokeColor : 'green'
strokeColor : 'green',
title: 'My Polygon'
});
mapView.addPolygon(polygon);
```
Expand All @@ -439,6 +442,7 @@ var circle = maps.createCircle({
fillColor: 'blue', // Default: transparent
strokeWidth : 3,
strokeColor : 'orange'
title: 'My Circle'
});
mapView.addCircle(circle);
```
Expand Down
9 changes: 9 additions & 0 deletions ios/Classes/TiGooglemapsAnnotationProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@ - (void)setSubtitle:(id)value
[self replaceValue:value forKey:@"subtitle" notification:NO];
}

- (void)setZIndex:(id)value
{
ENSURE_UI_THREAD_1_ARG(value);
ENSURE_TYPE(value, NSNumber);

[[self marker] setZIndex:[TiUtils intValue:value]];
[self replaceValue:value forKey:@"zIndex" notification:NO];
}

- (void)setCenterOffset:(id)args
{
ENSURE_UI_THREAD_1_ARG(args);
Expand Down
9 changes: 9 additions & 0 deletions ios/Classes/TiGooglemapsCircleProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@ - (void)setStrokeWidth:(id)value
[self replaceValue:value forKey:@"strokeWidth" notification:NO];
}

- (void)setTitle:(id)value
{
ENSURE_UI_THREAD(setTitle, value);
ENSURE_TYPE(value, NSString);

[[self circle] setTitle:[TiUtils stringValue:value]];
[self replaceValue:value forKey:@"title" notification:NO];
}

#pragma mark Utilities

- (CLLocationCoordinate2D)positionFromPoint:(id)point
Expand Down
9 changes: 9 additions & 0 deletions ios/Classes/TiGooglemapsPolygonProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,13 @@ - (void)setGeodesic:(id)value
[self replaceValue:value forKey:@"setGeodesic" notification:NO];
}

- (void)setTitle:(id)value
{
ENSURE_UI_THREAD(setTitle, value);
ENSURE_TYPE(value, NSString);

[[self polygon] setTitle:[TiUtils stringValue:value]];
[self replaceValue:value forKey:@"title" notification:NO];
}

@end
9 changes: 9 additions & 0 deletions ios/Classes/TiGooglemapsPolylineProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,13 @@ - (void)setGeodesic:(id)value
[self replaceValue:value forKey:@"setGeodesic" notification:NO];
}

- (void)setTitle:(id)value
{
ENSURE_UI_THREAD(setTitle, value);
ENSURE_TYPE(value, NSString);

[[self polyline] setTitle:[TiUtils stringValue:value]];
[self replaceValue:value forKey:@"title" notification:NO];
}

@end
2 changes: 1 addition & 1 deletion ios/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# this is your module manifest and used by Titanium
# during compilation, packaging, distribution, etc.
#
version: 3.6.1
version: 3.7.0
apiversion: 2
architectures: armv7 arm64 i386 x86_64
description: ti.googlemaps
Expand Down

0 comments on commit 63d4f95

Please sign in to comment.