Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
hansemannn committed Mar 11, 2019
1 parent 09b4593 commit 7035062
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 172 deletions.
6 changes: 3 additions & 3 deletions Classes/TiGooglemapsAutocompleteDialogProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ - (void)viewController:(GMSAutocompleteViewController *)viewController didFailAu
[self fireEvent:@"error"
withObject:@{
@"error" : [error localizedDescription],
@"code" : NUMINTEGER([error code])
@"code" : @([error code])
}];
}

Expand Down Expand Up @@ -125,8 +125,8 @@ + (NSDictionary *)dictionaryFromPlace:(GMSPlace *)place
return @{
@"name" : [place name],
@"placeID" : [place placeID],
@"latitude" : NUMDOUBLE([place coordinate].latitude),
@"longitude" : NUMDOUBLE([place coordinate].longitude),
@"latitude" : @([place coordinate].latitude),
@"longitude" : @([place coordinate].longitude),
@"formattedAddress" : [place formattedAddress],
@"addressComponents" : [TiGooglemapsAutocompleteDialogProxy arrayFromAddressComponents:[place addressComponents]]
};
Expand Down
4 changes: 2 additions & 2 deletions Classes/TiGooglemapsIndoorDisplayProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ - (void)didChangeActiveBuilding:(GMSIndoorBuilding *)building
}

return @{
@"defaultLevelIndex" : NUMUINTEGER([indoorBuilding defaultLevelIndex]),
@"isUnderground" : NUMBOOL([indoorBuilding isUnderground]),
@"defaultLevelIndex" : @([indoorBuilding defaultLevelIndex]),
@"isUnderground" : @([indoorBuilding isUnderground]),
@"levels" : levels
};
}
Expand Down
16 changes: 8 additions & 8 deletions Classes/TiGooglemapsModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ - (void)reverseGeocoder:(NSArray *)args

if (!response.results || response.results.count == 0) {
[propertiesDict setValue:@"No places found" forKey:@"error"];
[propertiesDict setValue:NUMINT(1) forKey:@"code"];
[propertiesDict setValue:NUMBOOL(NO) forKey:@"success"];
[propertiesDict setValue:@(1) forKey:@"code"];
[propertiesDict setValue:@(NO) forKey:@"success"];
} else {
[propertiesDict setValue:NUMINT(0) forKey:@"code"];
[propertiesDict setValue:NUMBOOL(YES) forKey:@"success"];
[propertiesDict setValue:@(0) forKey:@"code"];
[propertiesDict setValue:@(YES) forKey:@"success"];
}

NSArray *invocationArray = [[NSArray alloc] initWithObjects:&propertiesDict count:1];
Expand Down Expand Up @@ -193,8 +193,8 @@ - (NSArray *)decodePolylinePoints:(NSArray *)args

for (NSUInteger i = 0; i < path.count; i++) {
CLLocationCoordinate2D location = [path coordinateAtIndex:i];
[coordinates addObject:@{ @"latitude" : NUMDOUBLE(location.latitude),
@"longitude" : NUMDOUBLE(location.longitude) }];
[coordinates addObject:@{ @"latitude" : @(location.latitude),
@"longitude" : @(location.longitude) }];
}

return coordinates;
Expand All @@ -211,8 +211,8 @@ - (NSDictionary *_Nullable)dictionaryFromAddress:(GMSAddress *)address
NSMutableDictionary *result = [NSMutableDictionary dictionary];

if (address.coordinate.latitude && address.coordinate.longitude) {
[result setObject:NUMDOUBLE(address.coordinate.latitude) forKey:@"latitude"];
[result setObject:NUMDOUBLE(address.coordinate.longitude) forKey:@"longitude"];
[result setObject:@(address.coordinate.latitude) forKey:@"latitude"];
[result setObject:@(address.coordinate.longitude) forKey:@"longitude"];
}

if (address.thoroughfare) {
Expand Down
6 changes: 3 additions & 3 deletions Classes/TiGooglemapsPlacePickerDialogProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ - (void)placePicker:(GMSPlacePickerViewController *)viewController didFailWithEr
[self fireEvent:@"error"
withObject:@{
@"error" : [error localizedDescription],
@"code" : NUMINTEGER([error code])
@"code" : @([error code])
}];
}

Expand Down Expand Up @@ -112,8 +112,8 @@ + (NSDictionary *)dictionaryFromPlace:(GMSPlace *)place
return @{
@"name" : [place name],
@"placeID" : [place placeID],
@"latitude" : NUMDOUBLE([place coordinate].latitude),
@"longitude" : NUMDOUBLE([place coordinate].longitude),
@"latitude" : @([place coordinate].latitude),
@"longitude" : @([place coordinate].longitude),
@"formattedAddress" : NULL_IF_NIL([place formattedAddress]),
@"addressComponents" : [TiGooglemapsPlacePickerDialogProxy arrayFromAddressComponents:[place addressComponents]]
};
Expand Down
6 changes: 3 additions & 3 deletions Classes/TiGooglemapsTileProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ - (void)receiveTileWithX:(NSUInteger)x
{
if ([self _hasListeners:@"receivetile"]) {
NSDictionary *event = @{
@"x" : NUMUINTEGER(x),
@"y" : NUMUINTEGER(y),
@"zoom" : NUMUINTEGER(zoom),
@"x" : @(x),
@"y" : @(y),
@"zoom" : @(zoom),
@"image" : [[TiBlob alloc] initWithImage:image]
};

Expand Down
68 changes: 34 additions & 34 deletions Classes/TiGooglemapsView.m
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ - (BOOL)clusterManager:(GMUClusterManager *)clusterManager didTapCluster:(id<GMU
if ([[self proxy] _hasListeners:@"clusterclick"]) {
[[self proxy] fireEvent:@"clusterclick"
withObject:@{
@"latitude" : NUMDOUBLE(cluster.position.latitude),
@"longitude" : NUMDOUBLE(cluster.position.longitude),
@"count" : NUMUINTEGER(cluster.count),
@"latitude" : @(cluster.position.latitude),
@"longitude" : @(cluster.position.longitude),
@"count" : @(cluster.count),
@"clusterItems" : [self arrayFromClusterItems:cluster.items]
}];
}
Expand All @@ -134,8 +134,8 @@ - (BOOL)clusterManager:(GMUClusterManager *)clusterManager didTapClusterItem:(id
if ([[self proxy] _hasListeners:@"clusteritemclick"]) {
[[self proxy] fireEvent:@"clusteritemclick"
withObject:@{
@"latitude" : NUMDOUBLE(clusterItem.position.latitude),
@"longitude" : NUMDOUBLE(clusterItem.position.longitude),
@"latitude" : @(clusterItem.position.latitude),
@"longitude" : @(clusterItem.position.longitude),
@"title" : [(TiPOIItem *)clusterItem title] ?: [NSNull null],
@"subtitle" : [(TiPOIItem *)clusterItem subtitle] ?: [NSNull null],
@"userData" : [(TiPOIItem *)clusterItem userData] ?: [NSNull null]
Expand All @@ -153,9 +153,9 @@ - (void)mapView:(GMSMapView *)mapView willMove:(BOOL)gesture
[[self proxy] fireEvent:@"regionwillchange"
withObject:@{
@"map" : [self proxy],
@"latitude" : NUMDOUBLE(mapView.camera.target.latitude),
@"longitude" : NUMDOUBLE(mapView.camera.target.longitude),
@"gesture" : NUMBOOL(gesture)
@"latitude" : @(mapView.camera.target.latitude),
@"longitude" : @(mapView.camera.target.longitude),
@"gesture" : @(gesture)
}];
}
}
Expand All @@ -164,11 +164,11 @@ - (void)mapView:(GMSMapView *)mapView didChangeCameraPosition:(GMSCameraPosition
{
if ([[self proxy] _hasListeners:@"regionchanged"]) {
NSMutableDictionary *updatedRegion = [NSMutableDictionary dictionaryWithDictionary:@{
@"latitude" : NUMDOUBLE(position.target.latitude),
@"longitude" : NUMDOUBLE(position.target.longitude),
@"zoom" : NUMFLOAT(position.zoom),
@"bearing" : NUMDOUBLE(position.bearing),
@"viewingAngle" : NUMDOUBLE(position.viewingAngle)
@"latitude" : @(position.target.latitude),
@"longitude" : @(position.target.longitude),
@"zoom" : @(position.zoom),
@"bearing" : @(position.bearing),
@"viewingAngle" : @(position.viewingAngle)
}];

[(TiGooglemapsViewProxy *)[self proxy] replaceValue:updatedRegion forKey:@"region" notification:NO];
Expand All @@ -193,8 +193,8 @@ - (void)mapView:(GMSMapView *)mapView didTapAtCoordinate:(CLLocationCoordinate2D
[[self proxy] fireEvent:@"mapclick"
withObject:@{
@"map" : [self proxy],
@"latitude" : NUMDOUBLE(coordinate.latitude),
@"longitude" : NUMDOUBLE(coordinate.longitude)
@"latitude" : @(coordinate.latitude),
@"longitude" : @(coordinate.longitude)
}];
}
}
Expand All @@ -205,8 +205,8 @@ - (void)mapView:(GMSMapView *)mapView didLongPressAtCoordinate:(CLLocationCoordi
[[self proxy] fireEvent:@"longclick"
withObject:@{
@"map" : [self proxy],
@"latitude" : NUMDOUBLE(coordinate.latitude),
@"longitude" : NUMDOUBLE(coordinate.longitude)
@"latitude" : @(coordinate.latitude),
@"longitude" : @(coordinate.longitude)
}];
}
}
Expand All @@ -219,8 +219,8 @@ - (BOOL)mapView:(GMSMapView *)mapView didTapMarker:(GMSMarker *)marker
@"clicksource" : @"pin",
@"annotation" : [self dictionaryFromMarker:marker],
@"map" : [self proxy],
@"latitude" : NUMDOUBLE(marker.position.latitude),
@"longitude" : NUMDOUBLE(marker.position.longitude)
@"latitude" : @(marker.position.latitude),
@"longitude" : @(marker.position.longitude)
}];
}

Expand All @@ -235,8 +235,8 @@ - (void)mapView:(GMSMapView *)mapView didTapInfoWindowOfMarker:(GMSMarker *)mark
@"clicksource" : @"infoWindow",
@"annotation" : [self dictionaryFromMarker:marker],
@"map" : [self proxy],
@"latitude" : NUMDOUBLE(marker.position.latitude),
@"longitude" : NUMDOUBLE(marker.position.longitude)
@"latitude" : @(marker.position.latitude),
@"longitude" : @(marker.position.longitude)
}];
}
}
Expand Down Expand Up @@ -347,19 +347,19 @@ - (NSDictionary *)dictionaryFromCameraPosition:(GMSCameraPosition *)position
}

return @{
@"latitude" : NUMDOUBLE(position.target.latitude),
@"longitude" : NUMDOUBLE(position.target.longitude),
@"zoom" : NUMFLOAT(position.zoom),
@"viewingAngle" : NUMDOUBLE(position.viewingAngle),
@"bearing" : NUMDOUBLE([position bearing])
@"latitude" : @(position.target.latitude),
@"longitude" : @(position.target.longitude),
@"zoom" : @(position.zoom),
@"viewingAngle" : @(position.viewingAngle),
@"bearing" : @([position bearing])
};
}

- (NSDictionary *)dictionaryFromCoordinate:(CLLocationCoordinate2D)coordinate
{
return @{
@"latitude" : NUMDOUBLE(coordinate.latitude),
@"longitude" : NUMDOUBLE(coordinate.longitude)
@"latitude" : @(coordinate.latitude),
@"longitude" : @(coordinate.longitude)
};
}

Expand All @@ -370,8 +370,8 @@ - (NSDictionary *)dictionaryFromMarker:(GMSMarker *)marker
}

return @{
@"latitude" : NUMDOUBLE(marker.position.latitude),
@"longitude" : NUMDOUBLE(marker.position.longitude),
@"latitude" : @(marker.position.latitude),
@"longitude" : @(marker.position.longitude),
@"userData" : marker.userData ?: [NSNull null],
@"title" : marker.title ?: [NSNull null],
@"subtitle" : marker.snippet ?: [NSNull null]
Expand All @@ -383,16 +383,16 @@ - (id)overlayTypeFromOverlay:(GMSOverlay *)overlay
ENSURE_UI_THREAD(overlayTypeFromOverlay, overlay);

if ([overlay isKindOfClass:[GMSPolygon class]]) {
return NUMINTEGER(TiGooglemapsOverlayTypePolygon);
return @(TiGooglemapsOverlayTypePolygon);
} else if ([overlay isKindOfClass:[GMSPolyline class]]) {
return NUMINTEGER(TiGooglemapsOverlayTypePolyline);
return @(TiGooglemapsOverlayTypePolyline);
} else if ([overlay isKindOfClass:[GMSCircle class]]) {
return NUMINTEGER(TiGooglemapsOverlayTypeCircle);
return @(TiGooglemapsOverlayTypeCircle);
}

NSLog(@"[ERROR] Unknown overlay provided: %@", [overlay class])

return NUMINTEGER(TiGooglemapsOverlayTypeUnknown);
return @(TiGooglemapsOverlayTypeUnknown);
}

- (id)overlayProxyFromOverlay:(GMSOverlay *)overlay
Expand Down
96 changes: 0 additions & 96 deletions ios/.clang-format

This file was deleted.

23 changes: 0 additions & 23 deletions ios/.gitignore

This file was deleted.

0 comments on commit 7035062

Please sign in to comment.