谷歌地图iOS标记在手指上显示标题

问题描述:

我现在在我的应用程序中有一些代码可以显示应用程序,通过触摸它可以存储所触摸标记的位置,并且会为该标记位置添加动画。每个标记都有一个标题(我将通过数据库使用该标记来访问标记ID的信息)。谷歌地图iOS标记在手指上显示标题

当我触摸带有标题的标记时,它将显示在标记上方的白色框中,我无法摆脱。我似乎无法在网上找到任何关于此的信息,而且我的代码中没有任何内容可以创建白盒。我将粘贴下面的代码。

谢谢。

- (BOOL)mapView:(GMSMapView *)mapView didTapMarker:(GMSMarker *)myMarker { 
    // NSString* title = myMarker.title; 
    CLLocationCoordinate2D coord = myMarker.position; 
    latitude2 = coord.latitude; 
    longitude2 = coord.longitude; 
    [mapView animateToZoom:20]; 
} 

-(void)addMyLocationMarker 
{ 
    mapIcon = @"smallmapicon"; 
    myMarker.map = nil; 
    CLLocationCoordinate2D coordi = CLLocationCoordinate2DMake(myLatitude,myLongitude); 
    myMarker=[GMSMarker markerWithPosition:coordi]; 
    myMarker.map = self.mapView; 
    myMarker.appearAnimation = kGMSMarkerAnimationPop; 
    myMarker.title = @"Test"; 
    UIImage * image = [UIImage imageNamed:mapIcon]; 
    CGSize sacleSize = CGSizeMake(55, 55); 
    UIGraphicsBeginImageContextWithOptions(sacleSize, NO, 0.0); 
    [image drawInRect:CGRectMake(0, 0, sacleSize.width, sacleSize.height)]; 
    UIImage * resizedImage = UIGraphicsGetImageFromCurrentImageContext(); 
    UIGraphicsEndImageContext(); 
    myMarker.icon = resizedImage; 
    NSLog(@"movement"); 

} 
+0

所以你不需要这个称号? –

如果你不想打开信息窗口,然后设置如下属性:

mapView.selectedMarker = nil; 

一样,

- (BOOL)mapView:(GMSMapView *)mapView didTapMarker:(GMSMarker *)myMarker { 

//set selectedMarker to nil on Mapview 

mapView.selectedMarker = nil; 

}