Determine is user is outside polygon area with Apple Maps - ios

Is there any possibility to determine whether a user is inside or outside of a polygon area that I have marked on the map?
I would like to trigger an event if the user goes outside the area (only within the app, so no need for region monitoring)

I was having the same problem on Android a while back.
I don't think this functionality is provided by IOS either, so you will have to find a way of making a custom function involving this:
Point In Polygon Algorithm

I found the solution here: - This takes a MKPolygon (which is important in this manner, since we can then know that the area is closed. So this is not possible to do if you make multiple polylines, since there is no good way of saying that they are connected to each other.

Related

About Drawing Maps In CarpPlay

I want to draw directions to a specific location in CarPlay. I realized that there are two different options that can be made regarding this. First of all, drawing a direct route from current location to the desired location. The second is to draw the route after showing our current location and selecting the location which we want to go on the map.
Which would make more sense for me to do?
Which authorization is appropriate for the situations I have mentioned?
com.developer.apple.carplay-parking or com.developer.apple.carplay-maps?
Parking or Map?
If you are developing a CarPlay application I would appreciate it if you would also write about the resources you used on the subject.

How manage when several annotations has similar or the same coordinates and want to show them?

I have an app (iPhone) that uses MapKit and users can create things on the map (annotations in the remote database, with latitude and longitude).
Problem is that very often users put things in the same building, very close, even in the same coordinates. So you only see the most up-to-date annotation unless you tap it and another is shown, but the usability of this is horrible. No users realize they can do that.
Therefore I guess a way to group close points and when tap, show all of them. It seems the first step can be done with clusters and I see several libraries for iOS for that:
http://cocoapods.org/?q=on%3Aios%20cluster
I would like to know if you have any idea or suggestion to solve the second problem, or the whole problem.
Thanks in advance.
Depending upon the clustering library used, you may be able to get the clustered region that is represented. Then, upon cluster marker tap, you could zoom to that region.
The JS library Leaflet has this behavior so you can see what it's like:
http://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-zoomtobounds.html
I realize this is a JS library not ObjC, but just linking it for demo purposes.

iOS MapKit - defining irregular touchable regions

I'm working on an app that lets a user select locations on a map. The entire map is subdivided into irregular regions (administrative boundaries), and when a user touches a point on a map, I need to be able to figure out which region the point belongs to. Just to clarify, there is no finite set of points for a user to choose from, they just tap anywhere on the map.
What is the best way to achieve this? I have been looking at MKPolygon class but cannot really figure out if this is the way to go. If it is, would I be using intersectsMapRect: method of the MKOverlay protocol to check for a match? Are there any good tutorials on this kind of map operations?
A good approach here might be the MapBox iOS SDK and it's RMInteractiveSource, which is designed for this. Check out this sample app which shows interactive regions.
This is done by a space-optimized, offline-capable key-value store of sorts that keys pixels at varying zoom levels to arbitrary content values (region name, data, imagery, etc.)
In MapKit proper, you'll need some sort of spatial analysis (maybe Spatialite?) to determine intersections between points touched and irregularly-shaped regions.

Subclassing MKMapView to provide custom maps?

I'd like to provide custom navigation maps in my iOS 6 application. I've tried adding overlay views that shows these custom maps in MKMapView and it didn't work well because it needs a higher zoom level than what Apple's component can provide (the desired zoom level is about 10 screen points per meter in the map).
The question is, is subclassing MKMapView a good way to approach to this? The primary reason is I'd like to take advantage of MKMapView's coordinate conversion functions:
convertCoordinate:toPointToView:
convertPoint:toCoordinateFromView:
convertRegion:toRectToView:
convertRect:toRegionFromView:
Those functions makes it easy to convert screen points to world coordinates (latitude/longitude) and vice-versa.
Thanks in advance!
I don't think you are going to have much luck with subclassing MKMapView. There is a lot going on behind the scenes related to tile loading that you cannot access.
I would guess you would be better served using something along the lines of the MapBox iOS SDK or another similar map engine.
It allows you to specify your own tile sources and has plenty of examples to show you how it is done. It also had functions, like map kit, to handle converting values to and from lat/lon.

iPad Object Detection

I want to build an iPad app that detect an alphabet physical shape placed on the iPad screen and print the alphabet to the screen after processing the object detection. Is this doable?
I am trying to find a way to implement this, but could not find any article or online resource that guide me to that.
Thanks,
I would imagine you could start by looking at the various pens and stylus's that are available for iPads. Look at how they work. Then you would need to see if you cna make an object that will activate the touch mechanism over a defined area in the same way, for example - a line, and see if you can detech the touch points along the line. Sorting all that out will effectively get you started.

Resources