fix: overlays click not working in iOS
MODIFY
src/ios/GoogleMaps/PluginCircle.m
src/ios/GoogleMaps/PluginCircle.m
Boolean isVisible = [[command.arguments objectAtIndex:1] boolValue];
// Update the property
- NSString *propertyId = [NSString stringWithFormat:@"circle_property_%lu", (unsigned long)circle.hash];
+ NSString *propertyId = [key stringByReplacingOccurrencesOfString:@"circle_" withString:@"circle_property_"];
NSMutableDictionary *properties = [NSMutableDictionary dictionaryWithDictionary:
[self.mapCtrl.objects objectForKey:propertyId]];
[properties setObject:[NSNumber numberWithBool:isVisible] forKey:@"isVisible"];
Boolean isClickable = [[command.arguments objectAtIndex:1] boolValue];
// Update the property
- NSString *propertyId = [NSString stringWithFormat:@"circle_property_%lu", (unsigned long)circle.hash];
+ NSString *propertyId = [key stringByReplacingOccurrencesOfString:@"circle_" withString:@"circle_property_"];
NSMutableDictionary *properties = [NSMutableDictionary dictionaryWithDictionary:
[self.mapCtrl.objects objectForKey:propertyId]];
[properties setObject:[NSNumber numberWithBool:isClickable] forKey:@"isClickable"];
NSString *circleId = [command.arguments objectAtIndex:0];
GMSCircle *circle = [self.mapCtrl.objects objectForKey:circleId];
- NSString *propertyId = [NSString stringWithFormat:@"circle_property_%lu", (unsigned long)circle.hash];
+ NSString *propertyId = [circleId stringByReplacingOccurrencesOfString:@"circle_" withString:@"circle_property_"];
[self.mapCtrl.objects removeObjectForKey:propertyId];
circle.map = nil;

MODIFY
src/ios/GoogleMaps/PluginGroundOverlay.m
src/ios/GoogleMaps/PluginGroundOverlay.m
//[self.imgCache removeObjectForKey:groundOverlayId];
- NSString *propertyId = [NSString stringWithFormat:@"groundoverlay_property_%lu", (unsigned long)groundOverlay.hash];
+ NSString *propertyId = [groundOverlayId stringByReplacingOccurrencesOfString:@"groundoverlay_" withString:@"groundoverlay_property"];
[self.mapCtrl.objects removeObjectForKey:propertyId];
[self.mapCtrl.objects removeObjectForKey:groundOverlayId];
Boolean isVisible = [[command.arguments objectAtIndex:1] boolValue];
// Update the property
- NSString *propertyId = [NSString stringWithFormat:@"groundoverlay_property_%lu", (unsigned long)groundOverlay.hash];
+ NSString *propertyId = [key stringByReplacingOccurrencesOfString:@"groundoverlay_" withString:@"groundoverlay_property_"];
NSMutableDictionary *properties = [NSMutableDictionary dictionaryWithDictionary:
[self.mapCtrl.objects objectForKey:propertyId]];
[properties setObject:[NSNumber numberWithBool:isVisible] forKey:@"isVisible"];
Boolean isClickable = [[command.arguments objectAtIndex:1] boolValue];
// Update the property
- NSString *propertyId = [NSString stringWithFormat:@"groundoverlay_property_%lu", (unsigned long)groundOverlay.hash];
+ NSString *propertyId = [key stringByReplacingOccurrencesOfString:@"groundoverlay_" withString:@"groundoverlay_property_"];
NSMutableDictionary *properties = [NSMutableDictionary dictionaryWithDictionary:
[self.mapCtrl.objects objectForKey:propertyId]];
[properties setObject:[NSNumber numberWithBool:isClickable] forKey:@"isClickable"];

MODIFY
src/ios/GoogleMaps/PluginPolygon.m
src/ios/GoogleMaps/PluginPolygon.m
// Get properties
- NSString *propertyId = [NSString stringWithFormat:@"polygon_property_%lu", (unsigned long)polygon.hash];
+ NSString *propertyId = [polygonKey stringByReplacingOccurrencesOfString:@"polygon_" withString:@"polygon_property_"];
NSMutableDictionary *properties = [NSMutableDictionary dictionaryWithDictionary:
[self.mapCtrl.objects objectForKey:propertyId]];
NSMutableArray *holePaths = (NSMutableArray *)[properties objectForKey:@"holePaths"];
// Get properties
- NSString *propertyId = [NSString stringWithFormat:@"polygon_property_%lu", (unsigned long)polygon.hash];
+ NSString *propertyId = [polygonKey stringByReplacingOccurrencesOfString:@"polygon_" withString:@"polygon_property_"];
NSMutableDictionary *properties = [NSMutableDictionary dictionaryWithDictionary:
[self.mapCtrl.objects objectForKey:propertyId]];
NSMutableArray *holePaths = (NSMutableArray *)[properties objectForKey:@"holePaths"];
// Get properties
- NSString *propertyId = [NSString stringWithFormat:@"polygon_property_%lu", (unsigned long)polygon.hash];
+ NSString *propertyId = [polygonKey stringByReplacingOccurrencesOfString:@"polygon_" withString:@"polygon_property_"];
NSMutableDictionary *properties = [NSMutableDictionary dictionaryWithDictionary:
[self.mapCtrl.objects objectForKey:propertyId]];
NSMutableArray *holePaths = (NSMutableArray *)[properties objectForKey:@"holePaths"];
// Get properties
- NSString *propertyId = [NSString stringWithFormat:@"polygon_property_%lu", (unsigned long)polygon.hash];
+ NSString *propertyId = [polygonKey stringByReplacingOccurrencesOfString:@"polygon_" withString:@"polygon_property_"];
NSMutableDictionary *properties = [NSMutableDictionary dictionaryWithDictionary:
[self.mapCtrl.objects objectForKey:propertyId]];
// Get properties
- NSString *propertyId = [NSString stringWithFormat:@"polygon_property_%lu", (unsigned long)polygon.hash];
+ NSString *propertyId = [polygonKey stringByReplacingOccurrencesOfString:@"polygon_" withString:@"polygon_property_"];
NSMutableDictionary *properties = [NSMutableDictionary dictionaryWithDictionary:
[self.mapCtrl.objects objectForKey:propertyId]];
NSMutableArray *holePaths = (NSMutableArray *)[properties objectForKey:@"holePaths"];
GMSPolygon *polygon = (GMSPolygon *)[self.mapCtrl.objects objectForKey:polygonKey];
// Get properties
- NSString *propertyId = [NSString stringWithFormat:@"polygon_property_%lu", (unsigned long)polygon.hash];
+ NSString *propertyId = [polygonKey stringByReplacingOccurrencesOfString:@"polygon_" withString:@"polygon_property_"];
NSMutableDictionary *properties = [NSMutableDictionary dictionaryWithDictionary:
[self.mapCtrl.objects objectForKey:propertyId]];
GMSPolygon *polygon = (GMSPolygon *)[self.mapCtrl.objects objectForKey:polygonKey];
// Get properties
- NSString *propertyId = [NSString stringWithFormat:@"polygon_property_%lu", (unsigned long)polygon.hash];
+ NSString *propertyId = [polygonKey stringByReplacingOccurrencesOfString:@"polygon_" withString:@"polygon_property_"];
NSMutableDictionary *properties = [NSMutableDictionary dictionaryWithDictionary:
[self.mapCtrl.objects objectForKey:propertyId]];
GMSPolygon *polygon = (GMSPolygon *)[self.mapCtrl.objects objectForKey:polygonKey];
// Get properties
- NSString *propertyId = [NSString stringWithFormat:@"polygon_property_%lu", (unsigned long)polygon.hash];
+ NSString *propertyId = [polygonKey stringByReplacingOccurrencesOfString:@"polygon_" withString:@"polygon_property_"];
NSMutableDictionary *properties = [NSMutableDictionary dictionaryWithDictionary:
[self.mapCtrl.objects objectForKey:propertyId]];
GMSPolygon *polygon = (GMSPolygon *)[self.mapCtrl.objects objectForKey:polygonKey];
// Get properties
- NSString *propertyId = [NSString stringWithFormat:@"polygon_property_%lu", (unsigned long)polygon.hash];
+ NSString *propertyId = [polygonKey stringByReplacingOccurrencesOfString:@"polygon_" withString:@"polygon_property_"];
NSMutableDictionary *properties = [NSMutableDictionary dictionaryWithDictionary:
[self.mapCtrl.objects objectForKey:propertyId]];
int zIndex = [[command.arguments objectAtIndex:1] intValue];
// Get properties
- NSString *propertyId = [NSString stringWithFormat:@"polygon_property_%lu", (unsigned long)polygon.hash];
+ NSString *propertyId = [polygonKey stringByReplacingOccurrencesOfString:@"polygon_" withString:@"polygon_property_"];
NSMutableDictionary *properties = [NSMutableDictionary dictionaryWithDictionary:
[self.mapCtrl.objects objectForKey:propertyId]];
Boolean isClickable = [[command.arguments objectAtIndex:1] boolValue];
// Get properties
- NSString *propertyId = [NSString stringWithFormat:@"polygon_property_%lu", (unsigned long)polygon.hash];
+ NSString *propertyId = [polygonKey stringByReplacingOccurrencesOfString:@"polygon_" withString:@"polygon_property_"];
NSMutableDictionary *properties = [NSMutableDictionary dictionaryWithDictionary:
[self.mapCtrl.objects objectForKey:propertyId]];
Boolean isVisible = [[command.arguments objectAtIndex:1] boolValue];
// Get properties
- NSString *propertyId = [NSString stringWithFormat:@"polygon_property_%lu", (unsigned long)polygon.hash];
+ NSString *propertyId = [polygonKey stringByReplacingOccurrencesOfString:@"polygon_" withString:@"polygon_property_"];
NSMutableDictionary *properties = [NSMutableDictionary dictionaryWithDictionary:
[self.mapCtrl.objects objectForKey:propertyId]];
-(void)remove:(CDVInvokedUrlCommand *)command
{
- [self.mapCtrl.executeQueue addOperationWithBlock:^{
-
- NSString *polygonKey = [command.arguments objectAtIndex:0];
- GMSPolygon *polygon = [self.mapCtrl.objects objectForKey:polygonKey];
// Apply to the polygon on UI thread.
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
- polygon.map = nil;
+ NSString *polygonKey = [command.arguments objectAtIndex:0];
+ GMSPolygon *polygon = [self.mapCtrl.objects objectForKey:polygonKey];
+ [self.mapCtrl.objects removeObjectForKey:[polygonKey stringByReplacingOccurrencesOfString:@"polygon_" withString:@"polygon_property_"]];
[self.mapCtrl.objects removeObjectForKey:polygonKey];
- [self.mapCtrl.objects removeObjectForKey:[polygonKey stringByReplacingOccurrencesOfString:@"_" withString:@"_holePaths_"]];
- [self.mapCtrl.objects removeObjectForKey:[polygonKey stringByReplacingOccurrencesOfString:@"_" withString:@"_property_"]];
+ polygon.map = nil;
+ polygon = nil;
CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}];
- }];
}

MODIFY
src/ios/GoogleMaps/PluginPolyline.m
src/ios/GoogleMaps/PluginPolyline.m
GMSPolyline *polyline = (GMSPolyline *)[self.mapCtrl.objects objectForKey:polylineKey];
// Get properties
- NSString *propertyId = [NSString stringWithFormat:@"polyline_property_%lu", (unsigned long)polyline.hash];
+ NSString *propertyId = [polylineKey stringByReplacingOccurrencesOfString:@"polyline_" withString:@"polyline_property_"];
NSMutableDictionary *properties = [NSMutableDictionary dictionaryWithDictionary:
[self.mapCtrl.objects objectForKey:propertyId]];
[properties setObject:[[GMSCoordinateBounds alloc] initWithPath:mutablePath] forKey:@"bounds"];
[self.mapCtrl.objects setObject:properties forKey:propertyId];
+ [[NSOperationQueue mainQueue] addOperationWithBlock:^{
+ [polyline setPath:mutablePath];
+
CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+ }];
}];
GMSPolyline *polyline = (GMSPolyline *)[self.mapCtrl.objects objectForKey:polylineKey];
// Get properties
- NSString *propertyId = [NSString stringWithFormat:@"polyline_property_%lu", (unsigned long)polyline.hash];
+ NSString *propertyId = [polylineKey stringByReplacingOccurrencesOfString:@"polyline_" withString:@"polyline_property_"];
NSMutableDictionary *properties = [NSMutableDictionary dictionaryWithDictionary:
[self.mapCtrl.objects objectForKey:propertyId]];
GMSPolyline *polyline = (GMSPolyline *)[self.mapCtrl.objects objectForKey:polylineKey];
// Get properties
- NSString *propertyId = [NSString stringWithFormat:@"polyline_property_%lu", (unsigned long)polyline.hash];
+ NSString *propertyId = [polylineKey stringByReplacingOccurrencesOfString:@"polyline_" withString:@"polyline_property_"];
NSMutableDictionary *properties = [NSMutableDictionary dictionaryWithDictionary:
[self.mapCtrl.objects objectForKey:propertyId]];
GMSPolyline *polyline = (GMSPolyline *)[self.mapCtrl.objects objectForKey:polylineKey];
// Get properties
- NSString *propertyId = [NSString stringWithFormat:@"polyline_property_%lu", (unsigned long)polyline.hash];
+ NSString *propertyId = [polylineKey stringByReplacingOccurrencesOfString:@"polyline_" withString:@"polyline_property_"];
NSMutableDictionary *properties = [NSMutableDictionary dictionaryWithDictionary:
[self.mapCtrl.objects objectForKey:propertyId]];
int zIndex = [[command.arguments objectAtIndex:1] intValue];
// Update the property
- NSString *propertyId = [NSString stringWithFormat:@"polyline_property_%lu", (unsigned long)polyline.hash];
+ NSString *propertyId = [polylineKey stringByReplacingOccurrencesOfString:@"polyline_" withString:@"polyline_property_"];
NSMutableDictionary *properties = [NSMutableDictionary dictionaryWithDictionary:
[self.mapCtrl.objects objectForKey:propertyId]];
[properties setObject:[NSNumber numberWithInt:zIndex] forKey:@"zIndex"];
[self.mapCtrl.executeQueue addOperationWithBlock:^{
NSString *polylineKey = [command.arguments objectAtIndex:0];
- GMSPolyline *polyline = (GMSPolyline *)[self.mapCtrl.objects objectForKey:polylineKey];
+ //GMSPolyline *polyline = (GMSPolyline *)[self.mapCtrl.objects objectForKey:polylineKey];
Boolean isClickable = [[command.arguments objectAtIndex:1] boolValue];
// Update the property
- NSString *propertyId = [NSString stringWithFormat:@"polyline_property_%lu", (unsigned long)polyline.hash];
+ NSString *propertyId = [polylineKey stringByReplacingOccurrencesOfString:@"polyline_" withString:@"polyline_property_"];
NSMutableDictionary *properties = [NSMutableDictionary dictionaryWithDictionary:
[self.mapCtrl.objects objectForKey:propertyId]];
[properties setObject:[NSNumber numberWithBool:isClickable] forKey:@"isClickable"];
GMSPolyline *polyline = (GMSPolyline *)[self.mapCtrl.objects objectForKey:polylineKey];
Boolean isVisible = [[command.arguments objectAtIndex:1] boolValue];
- NSString *propertyId = [NSString stringWithFormat:@"polyline_property_%lu", (unsigned long)polyline.hash];
+ NSString *propertyId = [polylineKey stringByReplacingOccurrencesOfString:@"polyline_" withString:@"polyline_property_"];
NSMutableDictionary *properties = [NSMutableDictionary dictionaryWithDictionary:
[self.mapCtrl.objects objectForKey:propertyId]];
[properties setObject:[NSNumber numberWithBool:isVisible] forKey:@"isVisible"];
Boolean isGeodisic = [[command.arguments objectAtIndex:1] boolValue];
// Update the property
- NSString *propertyId = [NSString stringWithFormat:@"polyline_property_%lu", (unsigned long)polyline.hash];
+ NSString *propertyId = [polylineKey stringByReplacingOccurrencesOfString:@"polyline_" withString:@"polyline_property_"];
NSMutableDictionary *properties = [NSMutableDictionary dictionaryWithDictionary:
[self.mapCtrl.objects objectForKey:propertyId]];
[properties setObject:[NSNumber numberWithBool:isGeodisic] forKey:@"isGeodisic"];
GMSPolyline *polyline = (GMSPolyline *)[self.mapCtrl.objects objectForKey:polylineKey];
[self.mapCtrl.objects removeObjectForKey:polylineKey];
- NSString *propertyId = [NSString stringWithFormat:@"polyline_property_%lu", (unsigned long)polyline.hash];
+ NSString *propertyId = [polylineKey stringByReplacingOccurrencesOfString:@"polyline_" withString:@"polyline_property_"];
[self.mapCtrl.objects removeObjectForKey:propertyId];
polyline.map = nil;
polyline = nil;

fix: overlays click not working in iOS #1794