Guest User

Untitled

a guest
Oct 24th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. - (void)viewDidLoad {
  2. [super viewDidLoad];
  3. NSMutableArray *markersArray = [[NSMutableArray alloc] init];
  4. for(int i=0; i<10; i++){
  5. GMSMarker *marker = [[GMSMarker alloc] init];
  6. marker.position = CLLocationCoordinate2DMake(latitude, longitude);
  7. marker.appearAnimation=YES;
  8. marker.opacity = 0.0;
  9. mapView.selectedMarker = marker;
  10. marker.map = mapView;
  11. [markersArray addObject:marker];
  12. }
  13. }
  14.  
  15. - (UIView*)mapView:(GMSMapView *)mapView markerInfoWindow:(GMSMarker *)marker {
  16. CustomInforwindow *customView = [[[NSBundle mainBundle] loadNibNamed:@"CustomInforwindow" owner:self options:nil] objectAtIndex:0];
  17. return customView;
  18. }
  19.  
  20. mapView.selectedMarker = marker; this will open the infowindow for the last marker
  21.  
  22. marker1.position = Locationcoorsinate2dobject;
  23. marker2.position = Locationcoorsinate2dobject;
  24. marker1.tappable = false;
  25. marker2.tappable = false;
  26.  
  27. marker2.icon = [UIImage imageNamed:@"yourinfowindow.png"];
  28. marker2.groundanchor = CGPointMake(marker1.groundanchor.x, marker1.gorundanchor.y + 2‌​.7);
Add Comment
Please, Sign In to add comment