简体   繁体   中英

How to set a scope to click on Annotation on an iOS map

I'm developing an iOS game with a Mapview, where I want to select an opponent from the multiple annotations on Map then I'll hit him. In the Map first user will select a range where he/she will find opponent and at that time some area(in particular angle) of map will fade in (pls see image), So the trouble which I have is I want to enable only those user/annotation which are in no-shaded area , this area will be an angle of 60 degrees, currently I'm using just an Imageview over the map to show the shaded area. How can I achieve this, Every suggestion would be appreciated. 在此处输入图片说明

Try this:

Convert all your Annotations lat, lat to x,y & find point inside the triangle. If so add those annotations.

determine whether point lies inside triangle

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