0

地域でのみマーカーを表示する方法GMSCirleそれ以外の場合はiOSで非表示にする方法、GMSCirleGoogleマップを使用して作成しましたが、そうでなければマーカーを非表示にする地域にのみマーカーを表示したいと思いますGMSCirle

ここに私のコードがあります:

GMSMarker *centerPoint=[GMSMarker markerWithPosition:CLLocationCoordinate2DMake(16.301687, 80.419235)];
    centerPoint.icon=[UIImage imageNamed:@"PinImage.png"];

    circ.fillColor = [UIColor colorWithRed:0.25 green:0 blue:0 alpha:0.05];
    circ.strokeColor = [UIColor blackColor];
    circ.strokeWidth = 5;
    circ.tappable=true;
    circ.map = mapView_;
    mapView_.settings.myLocationButton=YES;
    mapView_.settings.zoomGestures=YES;
    mapView_.settings.zoomGestures=YES;
    mapView_.settings.compassButton=YES;
    mapView_.settings.rotateGestures=YES;
    mapView_.settings.scrollGestures=YES;
    mapView_.settings.tiltGestures=YES;
    mapView_.myLocationEnabled=YES;

かなりのアイデアがあるかどうか、私は非常に苦労しました、前もって感謝します。

iOSで特定の領域にのみマーカーを表示する方法を知りたいだけです

4

1 に答える 1

4

次の簡単なアイデアを使用できます。

-(BOOL) checkMarker:(CLLocation*)locB

{
CLLocation *locA = [[CLLocation alloc]
                    initWithLatitude:24.590095
                    longitude:73.698256];

CLLocationDistance distance = [locA distanceFromLocation:locB];
NSLog(@"%f",distance);

if(distance <= RADIUS)
{
    NSLog(@"You are in Circle ");
    return true;
}
else
{
    NSLog(@"You are not in circle");
    return false;
    }
}
于 2014-08-04T11:01:35.297 に答える