How to get Notify when destination is reached in Google maps iOS - ios

Im using Google maps API To draw Route between two Points.
Here my destination location is fixed, Origin which is driver location is variable as the driver moves on. Now I want to get notify when driver reached destination. How can i do this.
Thank you..

In CLLocation didUpdateLocation delegate, check the distance(airial distance) between current location and your destination location. If the distance is very less(say 5 to 7 meters) you can say that the user has reached its destination. Hope it helps.

Related

Compute Heading iOS mapkit

I am working on functionality where I need to animate car driving on the map which is similar to what Uber has for customer application.
Current approach: I receive latest driver's coordinate from the api after particular polling interval, I use latest lat long and last known lat long to calculate directions using MKDirection. Currently I am able to animate car on this polyline received via directions api but I am not sure how to calculate heading to rotate car in a particular directions.
Note: Client's requirement is to use apple's native maps and api available and not to use Google Maps api.
Any insights on computing heading will be helpful.
Have you looked at this answer? https://stackoverflow.com/a/12696424/1364963
This should outline how to calculate a heading from two GPS coordinates.

Why does didUpdateLocation value differ from "my location" on map?

I'm getting a user's location over time and continuously overlaying this information on an MKMapView.
My problem is, the location isn't correct. Hear me out. MKMapView's blue dot for my current location is showing my location EXACTLY correct. Correct as could be. However, my location from didUpdateLocations is not this same location. It's showing up ~500 meters WNW. I'm storing locations as CLLocation and displaying them using their coordinate member.
I can walk around and it will show my path very precisely, but offset 500m WNW. Why is this happening? How do I get my current location without this offset?
Well, it seems that the problem is China's cartography. This is well-documented:
All Maps In China Are Wrong
What The Map?
A Solution (too complicated in my opinion)
...so.... what next?
I'm going to use Chinese map providers' APIs to provide a simpler solution (Autonavi, Baidu, etc)

Adjust RMMarker to user's current location automatically in oflline maps using MBTiles

Can i adjust RMMarker to user's current location using MBTiles without tapping on map? Is there any method or API to achieve this in mapbox without WiFi/3G? I just wanted to move RMMarker along with user just like in google maps.
You will probably want to use -[RMMapView setUserTrackingMode:], which uses Core Location and can operate with just the GPS even when offline (though with less accuracy).
Use setLocation:location method we get Latitude longitude while moving using Cellular data. The marker follows the location.

Check if user is in the defined area

In my app I want to check if my position is within defined area. I know the area coordinates and I want to check it when app is launched. How can I do it? As far as I know, geofencing can help me, but this technique always scans user's location. And I need only a manual check.
If you've got the users coordinates from a manual check with CLLocationManager then store them as a CLLocation object, then have another CLLocation object that contains the centre point of the region you want to check. You can then use [someUserLocationObject distanceFromLocation:centralPointOfArea] which will give you the distance the user is (in metres) from the central point, and you can make a determination from there.

How to find device location in blackberry

I have to find current user location in map view.How can i do that in black berry.Is it possible to find current location using GPS and show it on BlackBerry in India.Please provide some help.How can i achieve.
Thank You
Here is a tutorial on how to obtain GPS coordinates.
http://docs.blackberry.com/en/developers/deliverables/11944/CS_retrieving_the_location_of_a_BB_cont_fix_962151_11.jsp
Once, you obtain the coordinates, you can open the maps application and display the location on a map.
http://docs.blackberry.com/en/developers/deliverables/11944/CS_specifying_locations_on_a_map_using_location_893346_11.jsp

Resources