简体   繁体   中英

Pins with dynamic text in MapKit?

Is it possible to display dynamic text instead of a standard pin drop in MapKit?

For instance, the Trulia app shows house prices instead of a drop pin on their app, I'm wondering if they just have 10,000 pin images and are calling them like 4000.png or 5000.png or if they are somehow using dynamic pins and setting the text when the annotation is called.

See image:

在此处输入图片说明

Yes this is totally possible. In viewForAnnotation just make your image, or use a cached one, according to the data you are trying to display at that point. Then set that as the annotation's image property.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM