我更新了我的應用程序以使用Google Maps iOS SDK 1.3。除了GMSMarkers,一切似乎都行得通。它們要麼不出現,要麼出現錯誤的圖像。他們仍然對觸動作出反應,並且可以移動,但無形或腐敗。GMSMarker未顯示在1.3
這裏是添加GMSMarkers代碼:
playerAnnotation = [[CustomPlayerAnnotation markerWithPosition:coord] retain];
[playerAnnotation setType:ANNOTATION_PLAYER];
[playerAnnotation setIcon:[UIImage imageNamed:@"Icon-72.png"]];
[playerAnnotation setGroundAnchor:ccp(.5f, .5f)];
[playerAnnotation setAnimated:NO];
[playerAnnotation setTappable:YES];
[playerAnnotation setTitle:@"Player"];
[playerAnnotation setMap:gameMapView];
GMSMarker* test = [[GMSMarker markerWithPosition:gameMapView.myLocation.coordinate] retain];
[test setIcon:[UIImage imageNamed:@"Icon-72.png"]];
[test setGroundAnchor:ccp(.5f, .5f)];
[test setAnimated:NO];
[test setTappable:YES];
[test setTitle:@"Player"];
[test setMap:gameMapView];
而且CustomPlayerAnnotation是簡單地用一些額外的變量GMSMarker:
@interface CustomPlayerAnnotation : GMSMarker
{
AnnotationType type;
int tag;
struct CoordinatePair coordinatePair;
}
地圖與CustomPlayerAnnotation和測試GMSMarker:
我確實有一個lar地面疊加層的數量,以及去除疊加層使得標記重新出現,但是一些仍然具有不能正確顯示的奇怪圖像。它在1.2.2中工作正常,但不是1.3。
有沒有人有辦法讓標記工作?任何人都可以在GMSMarkers中看到這種行爲?
其他信息:該應用程序使用了cocos2d 2.0,導演加載地圖之前停止並添加GMSMapView中,如下所示:
UIWindow* window = [(ProjectFusionAppDelegate*)[[UIApplication sharedApplication] delegate] window];
[[[window subviews] objectAtIndex:0] addSubview:gameMapView];
我有在GMSMarker在谷歌地圖SDK IOS版本的類似問題:1.3.0.3430。我在它們之間繪製了GMSPolyline的點,所以我知道它們是,但沒有標記出現。也使用ARC。 – subv3rsion
我嘗試使用新的1.3.1,它仍然缺少標記。 – gameburke