Google マップ iOS SDK 1.3 を使用するようにアプリを更新しました。GMSMarkers を除いて、すべてが機能しているようです。それらは表示されないか、間違った画像で表示されます。それらは依然としてタッチに反応し、動かすことができますが、それ以外は見えないか壊れています。
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 をテストします。
大量の地面オーバーレイがあり、オーバーレイを削除するとマーカーが再表示されましたが、正しく表示されない奇妙な画像が残っているものもあります。1.2.2 では問題なく動作しますが、1.3 では動作しません。
マーカーを機能させるための回避策はありますか? GMSMarkers でこの動作を見た人はいますか?
その他の詳細: アプリは cocos2d 2.0 を使用しており、マップをロードする前にディレクターを停止し、次のように GMSMapView を追加します。
UIWindow* window = [(ProjectFusionAppDelegate*)[[UIApplication sharedApplication] delegate] window];
[[[window subviews] objectAtIndex:0] addSubview:gameMapView];