【发布时间】:2016-06-22 10:11:50
【问题描述】:
我的应用程序中现在有一些代码显示一个应用程序,在触摸时它将存储所触摸标记的位置,并将动画到该标记位置。我为每个标记都有一个标题(我将使用该标题通过数据库访问标记 ID 的信息)。
当我触摸带有标题的标记时,它会显示在标记上方的一个白色框中,我无法摆脱。我似乎无法在网上找到任何关于此的信息,而且我的代码中没有任何内容可以创建白盒。我将粘贴下面的代码。
谢谢。
- (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");
}
【问题讨论】:
-
所以你不需要那个标题?
标签: objective-c google-maps google-maps-markers google-maps-sdk-ios