0
for (int i=0; i<self.busRoutesArr.count-1; i++)
{
NSString *lat = [self.latArr objectAtIndex:i];
NSString *lon = [self.longArr objectAtIndex:i] ;
double lt=[lat doubleValue];
double ln=[lon doubleValue];
NSLog(@"%f, %f",lt,ln);
GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:lt
longitude:ln
zoom:60];
GMSMapView *mapView = [GMSMapView mapWithFrame:CGRectMake(10, 100, 250, 250) camera:camera];
GMSMarker *marker = [[GMSMarker alloc] init];
marker.position = camera.target;
marker.snippet = @"Hello World";
marker.map = mapView;
mapView.translatesAutoresizingMaskIntoConstraints = NO;
[self.view addSubview:mapView];
}
只顯示1個標記。我想顯示所有標記和連接它們的線我試圖在Google地圖上顯示多個標記和它們之間的一條線
看到這個http://stackoverflow.com/questions/21531974/how-do-i-create-multiple-markers-for-google-maps-in-my-ios-app –
與小型工作更改和循環。我可否知道空閒縮放值以查看所有這些標記。 –
你需要取出for循環'GMSMapView * mapView' –