Skip to navigation Skip to content
Simon Technology Blog
  • Architecture
  • Cloud
  • Database
  • Develop
  • Hardware
  • Industry
  • Language
  • Mobile
  • Opensource
  • OS
  • Web
Main Navigation

iOS map GPS position, realize basketball position and arrow sign on the map

October 9, 2021By Simo IOS

1.) I need a blue circle/location point on the map, as shown below.

>What is it called?
>How can I achieve it?

2.) How to display the following arrows on the pop-up screen?

I think what you are after is MKMapView; if so, you only need to Add it in the “Properties” panel, and there is an option (checkbox) in the “Properties” panel that allows you to “show user location”. By checking the box, it will make blue dots appear on the map (if you are using an iPhone simulation It will only show as Cupertio).

A lot of simple tutorials on getting started with the iPhone’s map view. This is a pretty good one. If you don’t like it, then I suggest you use Google’s’MkMapView Tutorial’, you should find a lot of useful information.

In order to get the user’s location (latitude and longitude), you need to do a few things:

1) Make sure you The CoreLocation framework (CoreLocation.framework) has been imported

2) You need to add the following to the .h file:

#import 

@interface exampleViewController: UIViewController
{
CLLocationManager *locationManager;
}

@property(nonatomic, retain)CLLocationManager *locationManager;

3) You need to add the following to the .m file (applicable to any place in your application)

This part will create a CLLocationManager Example:

self.locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
locationManager.desiredAccuracy = kCLLocationAccuracyBest;
[locationManager startUpdatingLoca tion];

Then, you can get the current latitude and longitude using the delegate method:

- (void)locationManager:(CLLocationManager *)manager 
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation
{
NSLog(@"New latitude: %f", newLocation.coordinate.latitude);< br /> NSLog(@"New longitude: %f", newLocation.coordinate.longitude);
}

You should also look at this existing question and this one, I think it should work Help you solve the second part of the problem.

Hope this helps.

1.) I need a blue circle on the map /Location point, as shown below.

>What is it called?
>How can I achieve it?

2.) How to display the following arrows on the pop-up screen?

I think what you are after is MKMapView; if so, you only need to add it in the interface builder and in the “Properties” inspector panel There is an option (checkbox) that allows you to “show user location”. By checking the box, it will make blue dots appear on the map (if you are using an iPhone simulator, it will only appear as Cupertio).

A lot of simple tutorials on getting started with iPhone’s map view. This is a pretty good one. If you don’t like it, then I suggest you use Google’s’MkMapView Tutorial’, you should find a lot of useful Information.

In order to get the user’s location (latitude and longitude), you need to do a few things:

1) Make sure you have imported the CoreLocation framework (CoreLocation.framework)

2) You need to add the following to the .h file:

#import 

@ interface exampleViewController: UIViewController
{
CLLocationManager *locationManager;
}

@property(nonatomic, retain)CLLocationManager *locationManager;

3) You need to add the following content to the .m file (applicable anywhere in your application)

This part will create an instance of CLLocationManager:

self.locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
locationManager.desiredAccuracy = kCLLocationAccuracyBest;
[locationManager startUpdatingLocation];

< p>Then, you can get the current latitude and longitude using the delegate method:

- ( void)locationManager:(CLLocationManager *)manager 
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation
{
NSLog(@"New latitude: %f" , newLocation.coordinate.latitude);
NSLog(@"New longitude: %f", newLocation.coordinate.longitude);
}

You should also take a look at this existing question And this one, I think it should help you solve the second part of the problem.

Hope this helps.

arrow, Ball, blue, GPS, Implementation, IOS, location, logo, Map, Mapping

Post navigation

iOS speech synthesis
iOS Catiledlayer crash

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 3923 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment Cancel reply

Your email address will not be published.

Recent Posts
  • Sencha-Touch-2 – Sencha Touch 2, Nested XML Analysis NodeValue
  • Add a separation line and format XML content
  • Is there a norm of simplified XML subsets?
  • Look at it when you write React
  • ReactJS – Present React Redux React-Router App to add the server to the Firebase hosted by the Firebase
Categories
  • Android
  • Apache
  • Apache Kafka
  • Asp
  • Auto-Test
  • Automated Build
  • Aws
  • Bitcoin
  • Browser
  • C & C++
  • C#
  • Centos
  • Cgi
  • Character
  • Cloud Service
  • Cocos2dx
  • Cordova
  • CSS
  • Data Structure
  • Delphi
  • Design Pattern
  • Dojo
  • Dubbo
  • ELK
  • Flex
  • football
  • Game
  • Hadoop
  • Hibernate
  • HTML
  • Hybrid
  • Intel
  • IOS
  • Ipad
  • iPhone
  • Java
  • Javascript
  • Jetty
  • JQuery
  • Jsp
  • Linux
  • Load Balance
  • Lua
  • Macbook
  • Macos
  • Mathematics
  • Micro Services
  • Monitoring
  • Motherboard
  • Mysql
  • Network Hardware
  • Network Marketing
  • Nginx
  • NodeJs
  • Nosql
  • Oracle
  • Os Theory
  • Performance
  • PHP
  • Postgresql
  • Power Designer
  • React
  • Redis
  • Regexp
  • Rom
  • Rss
  • Ruby
  • Search Engines
  • Shell Script
  • Silicon Valley
  • Silverlight
  • Software Design
  • Spring
  • Sql
  • Sqlite
  • Sqlserver
  • Storage
  • Storm
  • Surface
  • SVN
  • Swift
  • System Architecture
  • Tablet
  • Uncategorized
  • Unix
  • Visual Basic
  • Visual Studio
  • Web Crawler
  • WebService
  • Windows
  • Wireless
  • XML
  • ZooKeeper
Archives
  • October 2021
  • September 2021
  • August 2021
  • May 2021
  • April 2021
  • September 2020
  • September 2019
  • August 2019
  • June 2019
  • May 2019
  • April 2019
  • March 2019
© Simon Technology Blog 2025 • ThemeCountry Powered by WordPress