ios - how to show multiple info window of GMS mapView? -
i want add multiple info windows appear @ same time out tapping on marker . how implement ?
here code add multiple markers , adding infowindow?
(int = 0 ; < jsondatadict.count; ++) { nsdictionary *newdict = [jsondatadict objectatindex:i ]; double latitude = [[newdict valueforkey:@"lat"]doublevalue]; double longitute = [[newdict valueforkey:@"lng"]doublevalue]; cllocationcoordinate2d position = cllocationcoordinate2dmake(latitude, longitute); gmsmarker *marker = [gmsmarker markerwithposition:position]; nameofplace = [newdict valueforkey:@"name"]; // distanceofplace = [newdict valueforkey:@"distance"]; marker.icon = [self image:[uiimage imagenamed:@"pinpopoye.png"] scaledtosize:cgsizemake(75.0f, 60.0f)]; marker.appearanimation = kgmsmarkeranimationpop; marker.infowindowanchor = cgpointmake(1.1, 0.70); marker.map = self.mapview; [self.mapview setselectedmarker:marker]; //[self mapview:self.mapview markerinfowindow:marker]; } } - (uiview *)mapview:(gmsmapview *)mapview markerinfowindow:(gmsmarker *)marker { uiview *customview = [[uiview alloc] initwithframe:cgrectmake(0, 0, 60, 25)]; customview.backgroundcolor = [uicolor colorwithred:71.0/255.0 green:65.0/255.0 blue:65.0/255.0 alpha:0.8]; customview.layer.cornerradius = 5; customview.layer.maskstobounds = yes; namelabel = [[uilabel alloc]initwithframe:cgrectmake(0, 0, 60, 10)]; namelabel.text = nameofplace; namelabel.textcolor = [uicolor whitecolor]; namelabel.textalignment = nstextalignmentcenter; namelabel.font = [uifont systemfontofsize:8.0]; [customview addsubview:namelabel]; distancelabel = [[uilabel alloc]initwithframe:cgrectmake(0, 12, 60, 10)]; distancelabel.text = distanceofplace; distancelabel.textcolor = [uicolor whitecolor]; distancelabel.textalignment = nstextalignmentcenter; distancelabel.font = [uifont systemfontofsize:8.0]; [customview addsubview:distancelabel]; return customview; }
all have render info window along marker image, , set image pin icon (marker.icon).
here solution that: http://adhocmanager.com/posts/ios-google-maps-show-all-info-windows/
Comments
Post a Comment