ภาพรวม
คลาสนี้แสดงคำแนะนำสถานที่ของการค้นหาแบบเต็มตามสตริงที่พิมพ์เพียงบางส่วน
พร็อพเพอร์ตี้ | |
NSAttributedString * | attributedFullText |
คำอธิบายทั้งหมดของคำแนะนำเป็น NSAttributedString | |
NSAttributedString * | attributedPrimaryText |
ข้อความหลักของคำแนะนำเป็น NSAttributedString โดยทั่วไปจะเป็นชื่อของสถานที่ | |
NSAttributedString * | attributedSecondaryText |
ข้อความรองของคำแนะนำเป็น NSAttributedString โดยทั่วไปจะเป็นตำแหน่งของสถานที่ | |
NSString * | placeID |
ที่พักที่แสดงรหัสสถานที่ของคำแนะนำ เหมาะสำหรับใช้ในคำขอรายละเอียดสถานที่ | |
NSArray< NSString * > * | ประเภท |
ประเภทผลลัพธ์ของการเติมข้อความอัตโนมัติ | |
NSNumber * | distanceMeters |
ระยะห่างของเส้นตรงในหน่วยเมตรระหว่างต้นทางกับคำแนะนำนี้ หากมีการระบุต้นทางที่ถูกต้องใน GMSAutocompleteFilter ของคำขอ |
เอกสารประกอบเกี่ยวกับอสังหาริมทรัพย์
- (NSAttributedString*) attributedFullText [read, copy] |
คำอธิบายทั้งหมดของคำแนะนำเป็น NSAttributedString
เช่น "โรงอุปรากรซิดนีย์ ซิดนีย์ นิวเซาท์เวลส์ ออสเตรเลีย"
ทุกช่วงข้อความที่ตรงกับอินพุตของผู้ใช้จะมี kGMSAutocompleteMatchAttribute
ตัวอย่างเช่น คุณสามารถทำให้การจับคู่ทั้งหมดเป็นตัวหนาโดยใช้ enumerateAttribute:
UIFont *regularFont = [UIFont systemFontOfSize:[UIFont labelFontSize]]; UIFont *boldFont = [UIFont boldSystemFontOfSize:[UIFont labelFontSize]];
NSMutableAttributedString *bolded = [suggestion.attributedFullText mutableCopy]; [bolded enumerateAttribute:kGMSAutocompleteMatchAttribute inRange:NSMakeRange(0, bolded.length) options:0 usingBlock:^(id value, NSRange range, BOOL *stop) { UIFont *font = (value == nil) ? regularFont : boldFont; [bolded addAttribute:NSFontAttributeName value:font range:range]; }];
label.attributedText = bolded;
- (NSAttributedString*) attributedPrimaryText [read, copy] |
ข้อความหลักของคำแนะนำเป็น NSAttributedString โดยทั่วไปจะเป็นชื่อของสถานที่
เช่น "Sydney Opera House"
ช่วงข้อความที่ตรงกับอินพุตของผู้ใช้จะมี kGMSAutocompleteMatchAttribute
เช่น attributedFullText
- (NSAttributedString*) attributedSecondaryText [read, copy] |
ข้อความรองของคำแนะนำเป็น NSAttributedString โดยทั่วไปจะเป็นตำแหน่งของสถานที่
เช่น "ซิดนีย์ นิวเซาท์เวลส์ ออสเตรเลีย"
ช่วงข้อความที่ตรงกับอินพุตของผู้ใช้จะมี kGMSAutocompleteMatchAttribute
เช่น attributedFullText
อาจเป็น nil
- (NSString*) placeID [read, copy] |
ที่พักที่แสดงรหัสสถานที่ของคำแนะนำ เหมาะสำหรับใช้ในคำขอรายละเอียดสถานที่
- (NSArray<NSString *>*) ประเภท [read, copy] |
ประเภทผลลัพธ์ของการเติมข้อความอัตโนมัติ
ประเภทคือ NSString ค่าที่ถูกต้องเป็นทุกประเภทที่บันทึกไว้ใน <https://developers.google.com/places/ios-sdk/supported_types>
- (NSNumber*) distanceMeters [read, assign] |
ระยะห่างของเส้นตรงในหน่วยเมตรระหว่างต้นทางกับคำแนะนำนี้ หากมีการระบุต้นทางที่ถูกต้องใน GMSAutocompleteFilter
ของคำขอ