codenameone / codenameone-google-maps

Allows native google maps to run within Codename One applications
https://www.codenameone.com/
13 stars 24 forks source link

The path is not removing from maps in ios side #42

Open DurankGts opened 3 years ago

DurankGts commented 3 years ago

please check way the path objet is not removing in ios side

mc.removeMapObject(moCurrPath);

DurankGts commented 2 years ago

any support about this issue. This problem was tested in ios 15.5 iphone 13 and this method is not working...

DurankGts commented 2 years ago

the solution to this code is this:

your actually code in GoogleMaps libs in maven

com_codename1_googlemaps_InternalNativeMapsImpl.m

-(long long)finishPath:(long long)param{ __block GMSPolyline polyline = nil; int color = pathStrokeColor; int width = pathStrokeWidth; dispatch_async(dispatch_get_main_queue(), ^{ GMSMutablePath path = (GMSMutablePath*)param; polyline = [GMSPolyline polylineWithPath:path]; [path release]; polyline.strokeColor = UIColorFromRGB(color, 255); polyline.strokeWidth = width; polyline.map = mapView; }); return path; }

i just change async to sync

-(long long) finishPath : (long long) param { __block GMSPolyline *polyline = nil; int color = pathStrokeColor; int width = pathStrokeWidth;

dispatch_sync(dispatch_get_main_queue(), ^{
    GMSMutablePath *path   = (GMSMutablePath*) param;
    polyline = [GMSPolyline polylineWithPath : path];
    [path release];
    polyline.strokeColor = UIColorFromRGB(color, 255);
    polyline.strokeWidth = width;
    polyline.map = mapView;
});
return polyline;

}