All Projects → xeieshan → GoogleMapsHelper

xeieshan / GoogleMapsHelper

Licence: MIT license
An easy to integrate Model Based Google Maps Helper (SVHTTPClient, AFNetworking) That lets you Geo Code , Reverse Geocode, Get Directions , Places Autocomplete.

Programming Languages

objective c
16641 projects - #2 most used programming language
shell
77523 projects
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to GoogleMapsHelper

google maps
🗺 An unofficial Google Maps Platform client library for the Rust programming language.
Stars: ✭ 40 (+90.48%)
Mutual labels:  maps, directions, google-maps, directions-api
geocoder
Geocoder is a Typescript library which helps you build geo-aware applications by providing a powerful abstraction layer for geocoding manipulations
Stars: ✭ 28 (+33.33%)
Mutual labels:  autocomplete, google-maps, places, geocoder
Places
🌐 Turn any <input> into an address autocomplete
Stars: ✭ 5,322 (+25242.86%)
Mutual labels:  autocomplete, places, geocoder
Google Maps
Google Maps Web Services API wrapper for .NET
Stars: ✭ 171 (+714.29%)
Mutual labels:  maps, google-maps, geocoder
SimplePlacePicker
Android place picker module for searching and selecting a location on google maps
Stars: ✭ 42 (+100%)
Mutual labels:  maps, google-maps, places
Google Maps Services Js
Node.js client library for Google Maps API Web Services
Stars: ✭ 2,432 (+11480.95%)
Mutual labels:  maps, directions, places
React Places Autocomplete
React component for Google Maps Places Autocomplete
Stars: ✭ 1,265 (+5923.81%)
Mutual labels:  autocomplete, google-maps, geocoder
Airbnb Android Google Map View
This is a sample Android Application which has Google Map view similar to what AirBnb Android Application. Moving Markers like Uber/Ola. Custom Google Search for places. Recycler view with Animations added.
Stars: ✭ 175 (+733.33%)
Mutual labels:  autocomplete, maps, google-maps
svelte-mapbox
MapBox Map and Autocomplete components for Svelte (or Vanilla JS)
Stars: ✭ 267 (+1171.43%)
Mutual labels:  autocomplete, maps, google-maps
Placepicker
Free Android Map Place Picker alternative using Geocoder instead of Google APIs
Stars: ✭ 126 (+500%)
Mutual labels:  maps, google-maps, geocoder
EasyWayLocation
This library contain all utils related to google location. like, getting lat or long, Address and Location Setting dialog, many more...
Stars: ✭ 142 (+576.19%)
Mutual labels:  maps, google-maps, directions-api
svelte-googlemaps
Svelte Google Maps Components
Stars: ✭ 62 (+195.24%)
Mutual labels:  maps, google-maps, places
React Native Open Maps
🗺 A simple react-native library to perform cross-platform map actions (Google or Apple Maps)
Stars: ✭ 192 (+814.29%)
Mutual labels:  maps, google-maps
Gmapsfx
Java API for using Google Maps within a JavaFX application.
Stars: ✭ 233 (+1009.52%)
Mutual labels:  maps, google-maps
Googleapi
C# .NET Core Google Api (Maps, Places, Roads, Search, Translate). Supports all endpoints and requests / responses.
Stars: ✭ 346 (+1547.62%)
Mutual labels:  autocomplete, maps
Use Places Autocomplete
😎 📍 React hook for Google Maps Places Autocomplete.
Stars: ✭ 739 (+3419.05%)
Mutual labels:  autocomplete, google-maps
ember-google-maps
A friendly Ember addon for working with Google Maps.
Stars: ✭ 93 (+342.86%)
Mutual labels:  maps, google-maps
React Native Maps
React Native Mapview component for iOS + Android
Stars: ✭ 12,795 (+60828.57%)
Mutual labels:  maps, google-maps
Django Places
A django app for store places with autocomplete
Stars: ✭ 55 (+161.9%)
Mutual labels:  autocomplete, google-maps
Mimirsbrunn
Geocoding and reverse-geocoding (with OSM data)
Stars: ✭ 165 (+685.71%)
Mutual labels:  autocomplete, geocoder

GoogleMapsHelper

Read Me in Russian : http://gargo.of.by/googlemapshelper/

A GOOGLE MAPS Helper that help you do multiple tasks like

HOW TO USE

// using AFNetworking

[[AFGoogleMapsHelper sharedAFGoogleMapsHelper] geocodeAddressString:@"Arsenal Emirates" components:@{} completionHandler:^(MOGoogleGeocodeList *googleGeoCodeList, SPGoogleGeoCoderResponse responseCode, NSString *message) {
    
}];

CLLocationCoordinate2D emiratesStadium = { 51.555747, -0.108309};
CLLocationCoordinate2D stamfordBridge = { 51.481690, -0.190999 };

[[AFGoogleMapsHelper sharedAFGoogleMapsHelper] reverseGeocodeCoordinate:(emiratesStadium) resultTypes:@[] locationTypes:@[] completionHandler:^(MOGoogleGeocodeList *googleGeoCodeList, SPGoogleGeoCoderResponse responseCode, NSString *message) {
    
}];

[[AFGoogleMapsHelper sharedAFGoogleMapsHelper] getAutoCompleteFromGoogle:@"Arsenal Emirates Stadium, london" andAutoComplete:^(MOGoogleAutoCompleteList *googleAutocompleteList, SPGoogleGeoCoderResponse responseCode, NSString *message) {
    
}];

[[AFGoogleMapsHelper sharedAFGoogleMapsHelper] getDirections:emiratesStadium andCoordinateDestination:stamfordBridge andDrawPoints:^{
    
} andPlaceMarks:^(MKPolyline *polyLine, NSString *distance, NSString *duration, NSString *startAddress, NSString *endAddress, NSMutableArray *polyLineSetArray, NSMutableArray *directionsSetArray, NSMutableArray *distanceSetArray) {
    
}];

// Using SVHTTPClient

[[SVGoogleMapsHelper sharedGoogleMapHelper] geocodeAddressString:@"Arsenal Emirates" components:@{} completionHandler:^(MOGoogleGeocodeList *googleGeoCodeList, SPGoogleGeoCoderResponse responseCode, NSString *message) {
    
}];


[[SVGoogleMapsHelper sharedGoogleMapHelper] reverseGeocodeCoordinate:(emiratesStadium) resultTypes:@[] locationTypes:@[] completionHandler:^(MOGoogleGeocodeList *googleGeoCodeList, SPGoogleGeoCoderResponse responseCode, NSString *message) {
    
}];

[[SVGoogleMapsHelper sharedGoogleMapHelper] getAutoCompleteFromGoogle:@"Arsenal Emirates Stadium, london" andAutoComplete:^(MOGoogleAutoCompleteList *googleAutocompleteList, SPGoogleGeoCoderResponse responseCode, NSString *message) {
    
}];

[[SVGoogleMapsHelper sharedGoogleMapHelper] getDirections:emiratesStadium andCoordinateDestination:stamfordBridge andDrawPoints:^{
    
} andPlaceMarks:^(MKPolyline *polyLine, NSString *distance, NSString *duration, NSString *startAddress, NSString *endAddress, NSMutableArray *polyLineSetArray, NSMutableArray *directionsSetArray, NSMutableArray *distanceSetArray) {
    
}];

1- Geocode

It returns all these items :

  • MOGoogleGeocodeList *googleGeoCodeList,
  • SPGoogleGeoCoderResponse responseCode,
  • NSString *message

I Geocode @"Arsenal Emirates" and I got Printing description of googleGeoCodeList->_results->[0]:

{ "formatted_address" = "Hornsey Rd, London N7 7AJ, UK"; geometry = { bounds = { }; location = { lat = "51.5548885"; lng = "-0.108438"; }; "location_type" = APPROXIMATE; viewport = { northeast = { lat = "51.55623748029149"; lng = "-0.107089019708498"; }; southwest = { lat = "51.5535395197085"; lng = "-0.109786980291502"; }; }; }; kMOGoogleGeocodePlacemarksAddressComponents = ( { kMOAddressComponentsTypes = ( route ); "long_name" = "Hornsey Road"; "short_name" = "Hornsey Rd"; }, { kMOAddressComponentsTypes = ( "postal_town" ); "long_name" = London; "short_name" = London; }, { kMOAddressComponentsTypes = ( "administrative_area_level_2", political ); "long_name" = "Greater London"; "short_name" = "Greater London"; }, { kMOAddressComponentsTypes = ( "administrative_area_level_1", political ); "long_name" = England; "short_name" = England; }, { kMOAddressComponentsTypes = ( country, political ); "long_name" = "United Kingdom"; "short_name" = GB; }, { kMOAddressComponentsTypes = ( "postal_code" ); "long_name" = "N7 7AJ"; "short_name" = "N7 7AJ"; } ); kMOGoogleGeocodePlacemarksTypes = ( establishment, "point_of_interest", stadium ); "place_id" = "ChIJO14pRXYbdkgRkM-CgzxxADY"; }

2- Reverse Geocode

It returns all these items :

  • MOGoogleGeocodeList *googleGeoCodeList,
  • SPGoogleGeoCoderResponse responseCode,
  • NSString *message

Printing description for first item :

<__NSArrayI 0x6080000b1b20>( { "formatted_address" = "Emirates Stadium, London, UK"; geometry = { bounds = { northeast = { lat = "51.5561569"; lng = "-0.1069905"; }; southwest = { lat = "51.5539356"; lng = "-0.1098853"; }; }; location = { lat = "51.55572979999999"; lng = "-0.1083118"; }; "location_type" = ROOFTOP; viewport = { northeast = { lat = "51.5563952302915"; lng = "-0.1069905"; }; southwest = { lat = "51.5536972697085"; lng = "-0.1098853"; }; }; }; kMOGoogleGeocodePlacemarksAddressComponents = ( { kMOAddressComponentsTypes = ( premise ); "long_name" = "Emirates Stadium"; "short_name" = "Emirates Stadium"; }, { kMOAddressComponentsTypes = ( locality, political ); "long_name" = London; "short_name" = London; }, { kMOAddressComponentsTypes = ( "postal_town" ); "long_name" = London; "short_name" = London; }, { kMOAddressComponentsTypes = ( "administrative_area_level_2", political ); "long_name" = "Greater London"; "short_name" = "Greater London"; }, { kMOAddressComponentsTypes = ( "administrative_area_level_1", political ); "long_name" = England; "short_name" = England; }, { kMOAddressComponentsTypes = ( country, political ); "long_name" = "United Kingdom"; "short_name" = GB; } ); kMOGoogleGeocodePlacemarksTypes = ( premise ); "place_id" = ChIJuaX4rXcbdkgRX7nJ4iCVzT0; }} )

3- Autocomplete

It Returns all of these items :

  • MOGoogleAutoCompleteList *googleAutocompleteList,
  • SPGoogleGeoCoderResponse responseCode,
  • NSString *message

I wanted to search @"Arsenal Emirates Stadium, london" and I got following 2 results, I am showing first item

Printing description of ((MOPredictions *)0x0000600000282b70): { description = "Arsenal Football Club, Emirates Stadium, Hornsey Road, London, United Kingdom"; id = 695fdbc199ef136a3674dc5c3946d0901be24cf2; kMOPredictionsMatchedSubstrings = ( { length = 7; offset = 0; }, { length = 16; offset = 23; }, { length = 6; offset = 55; } ); kMOPredictionsTerms = ( { offset = 0; value = "Arsenal Football Club"; }, { offset = 23; value = "Emirates Stadium"; }, { offset = 41; value = "Hornsey Road"; }, { offset = 55; value = London; }, { offset = 63; value = "United Kingdom"; } ); kMOPredictionsTypes = ( establishment ); "place_id" = ChIJq3Y4mXYbdkgRinA5RgGR5tA; reference = "CmRcAAAA3_03PcjmlvYYAMB56q1NSPHAa6o4s5OZlZzmqKWVzl6m8wQu8kIAHqSFzY8M_fJC6tbdt5vQSOylmlp6vu8hMJ0areyjFCiETtOb2e1qkM9a8TbnHRoIGK83-h0iy9EaEhCgUDC5ODRWWeKhZZmXh3wHGhRRAUwm4UFKR6a689AJXsADrqKFNA"; }

4- Directions

It Returns All these Items :

  • MKPolyline *polyLine,
  • NSString *distance,
  • NSString *duration,
  • NSString *startAddress,
  • NSString *endAddress,
  • NSMutableArray *polyLineSetArray,
  • NSMutableArray *directionsSetArray,
  • NSMutableArray *distanceSetArray in a block.

I found directions between following CLLocationCoordinate2D's CLLocationCoordinate2D emiratesStadium = { 51.555747, -0.108309}; CLLocationCoordinate2D stamfordBridge = { 51.481690, -0.190999 };

Printing description of duration:

42 mins

Printing description of distance:

16.6 km

Printing description of startAddress:

Citizen Rd, London N7, UK

Printing description of endAddress:

19 Billing Pl, London SW10 9UN, UK

Plus Polyline object to be used in MKMapView

It also tells you Guidance strings which you can use :

  • Head southwest on Citizen Rd toward Hornsey Rd/A103,
  • Turn right onto Hornsey Rd/A103,
  • Turn left onto Tollington Rd/A503Continue to follow A503,
  • Continue straight onto Camden Rd/A503,
  • Turn left onto Camden St/A400Continue to follow A400,
  • Turn left onto Hampstead Rd/A400Continue to follow A400,
  • Turn right onto Euston Rd,
  • Merge onto Euston Rd/A501 via the ramp to Ring Road/A41/A40/KilburnContinue to follow A501,
  • Keep right to continue on Marylebone Flyover/A40Continue to follow A40,
  • Take the A3220 ramp to Hammersmith/Shepherd's Bush/White City/Earls Court,
  • At the roundabout, take the 1st exit onto W Cross Rte/A3220,
  • At the roundabout, take the 2nd exit onto Holland Rd/A3220Continue to follow A3220,
  • Keep right to continue on Warwick Gardens/A3220,
  • Turn left onto Pembroke Rd/A3220Continue to follow A3220,
  • Continue straight onto Earls Ct Rd/A3220Continue to follow A3220,
  • Turn right onto Fulham Rd/A308Continue to follow Fulham Rd,
  • Turn right,
  • Turn right,
  • Turn left
  • Destination will be on the left

Make sure you integrate AFNetworking, SVProgressHUD, SVHTTPClient

I was using CocoaPods so I used

  • pod 'SVHTTPRequest', '~> 0.5'
  • pod 'AFNetworking', '~> 3.0'
  • pod 'SVProgressHUD'

Dont forget to add condition in info.plist

  • App Transport > Arbitrary loads allow : YES
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].