I am trying to position my custom marker in iOS(Objective-C) with Google Maps.
Map view is all showing up fine with marker, however, moving the map will take the marker with it as its fetching current location. What I am looking for is the have it set to center of the map container, which will then fetch coordinates of map pin and display in search bar.
I am thinking I am doing this in reverse? I added the customer marker as a UIImage of the map container however it still does not show. Should I be getting the location from the position of the map marker, and then reverse geocoding address from there.
- (void)addPins:(float)lat andLng:(float)lng andName:(NSString*)strName withAddress:(NSString*)strAddr
{
// Creates a marker in the center of the map.
GMSMarker *marker = [[GMSMarker alloc] init];
marker.position = CLLocationCoordinate2DMake(currentUserLocation.coordinate.latitude, currentUserLocation.coordinate.longitude);
NSLog(@"lat : %f, lng : %f", lat, lng);
marker.icon = [UIImage imageNamed:@"map_pin"];
marker.title = strName;
marker.snippet = strAddr;
marker.appearAnimation = kGMSMarkerAnimationPop;
marker.map = mapView;
}
The user needs to be able to search and set their address, besides their current location.
Thanks