Ich benutze eine Google-Karte in iPhone App von Objective-C, es ist in Ordnung und der Marker ist an einem bestimmten Ort. Ich möchte, wenn Sie auf einen bestimmten Ort klicken, ändern Sie den Marker-Standort zum ausgewählten Ort, indem Sie auf die Karte klicken. Wie geht das? Vielen Dank im Voraus.Ändern Sie die Marker-Position durch onClick google map ios
mein Code:
GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:29.964996
longitude:30.939680 zoom:5
bearing:0
viewingAngle:0
];
_mapView = [GMSMapView mapWithFrame:viewOfMap.bounds camera:camera];
_mapView.autoresizingMask = UIViewAutoresizingFlexibleWidth|
UIViewAutoresizingFlexibleHeight;
[_mapView addObserver:self
forKeyPath:@"myLocation"
options:NSKeyValueObservingOptionNew
context:NULL];
[viewOfMap addSubview:_mapView];
dispatch_async(dispatch_get_main_queue(), ^{
//_mapView.myLocationEnabled = YES;
_mapView.myLocationEnabled = YES;
});
GMSMarker *marker = [[GMSMarker alloc] init];
marker.position = CLLocationCoordinate2DMake(lat, lag);
marker.map = _mapView;
prüfen diese Frage SO [28955976] (http://stackoverflow.com/questions/28955976/gmsmarker-icon-from-center-ios) und [16686795] (http: // Stackoverflow .com/questions/16686795/ios-google-maps-sdk-gsmarker-positionierung) wenn es dir helfen kann;) – KENdi