简体   繁体   中英

How to add multiple Pin point annotations to a Map

My scenario;

One hospital has many doctors . I need to show this on the webview .

I will place an annotation pin on the hospital. and when the user clicks on it, the popup with all the doctors who are visiting that hospital should appear.

在此处输入图片说明

As shown in the image below. The following image has been implemented using a library, but i don't want to use it. Is there any other way i could implement this.

The reason why i don't want to use that library - My superiors don't like, and i didn't ask why (I expect answers and not arguments as why i didn't ask the reason from my superiors ) :)

note: Sorry i don't have any code to demonstrate.

You can use the MKMapView class to create an embeddable map interface. Also able to add custom annotations using MKAnnotation protocol.

See the class reference for MKMapView and MKAnnotation .

That looks like a completely custom callout. You can learn the general way to make those in the MapCallouts sample code in Xcode.

The example you show has a lot of custom graphics which you won't be able to get without either using the graphics in the library (if the terms allow it) or creating them yourself. For example, you'll have to make the black background (and probably set it's transparency in the callout view), the green round rect, the blue chevron and the star badge. You'll need to learn how to make text with a shadow and with a white shadow inset. You'll also need to know how to stretch the background image to allow for different numbers of items inside.

Submit it to your superiors that they will be paying for this extra work (looks like around 40 hours), and if they're happy with that, start learning.

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