Sagit.Framework For IOS development framework introduction tutorial 14: stlocation obtaining map, GPS City, address, longitude, latitude, coordinate distance judgment, jump setting and third party map



This paper introduces the related functions of stlocation to obtain GPS coordinate information and jump to the third party map.

1. Basic definition of stlocation:

@interface STLocation : NSObject
typedef void (^OnLocationEnd)(STLocationModel *model);
@property (nonatomic,retain) STLocationModel *cityModel;
+ (instancetype)share;
//! is GPS available

//! get the distance between coordinates (in meters)
-(double)distince:(double) lat1 lng1:(double) lng1 lat2:(double) lat2 lng2:(double) lng2;
#Jump to pragma mark
//! jump to system settings
//! jump to third party map

2. Examples of basic usage:

A. Get current coordinates, city, address:

    [Sagit.Location start:^(STLocationModel *model) {

B. Jump to third party map: use current coordinates, or specified coordinates.

Jump map:

[Sagit.Location redirectToMap];

C. Prompt the user to turn on GPS:

/Check if GPS is on
        [ self.msgBox  confirm:STString (@ "% @ function needs to turn on the position positioning function, which is used to get people nearby. Do you want to set it now?", menu_ Love) Title: @ "message prompt" click: ^ void (nsinteger, btnindex, UIAlertView * view){
                [Sagit.Location redirectToSetting];
        }Oktext: @ "Settings"];


The basic functions of GPS are introduced here.