Cat Share, must boutiqueOriginal articles, welcome reprint. Reprint Please specify: Sanayu's BlogAddress: http://blog.csdn.net/u013357243One: EffectInput latitude and longitude, can get the corresponding place nameSecond: IdeasAlmost identical to the field code.1. Get the latitude and longitude of user input2. Create a Cllocation object based on the latitude and longitude of the user input3. Get the relevant landmark information based on the Cllocation objectThree: Code#import "ViewController.h"
---restore content starts---Basic Android itself with the Geocoder this class can also be achieved for the latitude and longitude of the positive and negative Yi, but its own bugs exist a lot, especially in the stability of the resolution here, Google provides geocoding stability more good, although its usage is a little more complex, In fact, its general working principle is the HTTP protocol, Google has an open interface, we will be the latitude and
MKDirectionsTransportType。var// Default is MKDirectionsTransportTypeAnystruct MKDirectionsTransportType : RawOptionSetType { // 驾驶。 staticvarget } // 步行。 staticvarget } // 所有。 staticvarget }}Mkmapitem
This class can jump directly to the Apple automatic map, complete the navigation function. (All right ...) )This is just a conversion: Clplacemark, Mkplacemark, Mkmapitem
Second, the interface
This simple interface is needless to say.
Iii. Navigati
: Overlay is the top layer of MapView. You can extend its ondraw interface to display some of your own items in MapView. MapView manages Overlay through MapView. getOverlays.
Projection: the conversion between GPS coordinates and device coordinates (GeoPoint and Point) in MapView ).
Locate the main categories in the system package:
LocationManager: This class provides the ability to access the location service and to obtain the best location provider. In addition, the near alert function can als
map of Baidu--geo-coding and anti-geocoding
One Goal,one Passion!
Geocoding:
Geocoding--that is, we parse the familiar address into latitude.
Address
latlng (coordinate)
Zhengzhou
34.7568711, 113.663221
Okay, the code is simple.
New coded Query Object
GeoCoder geocode = Geocoder.newinstance ();
New Query Object The condition to query
geocodeopt
Geocoding API is a service interface provided by Baidu. It is mainly used to provide translation services from address resolution to latitude and longitude coordinates or from latitude and longitude coordinates to addresses, you can send a request to receive returned data in JSON or XML format.
Most of the code and solutions provided on the Internet are based on Google map. In fact, their solutions are similar. Here, I will send a link to show you how to use Baidu map API> Web Service API> geoco
Situation One: geocodingStoryboard The code is as follows (the project does not import the Mapkit framework, but the running program does not crash): 1 #import "ViewController.h"2 #import3 4 @interfaceViewcontroller ()5@property (Weak, nonatomic) Iboutlet Uitextfield *addresstf;6@property (Weak, nonatomic) Iboutlet UILabel *Longitudelabel;7@property (Weak, nonatomic) Iboutlet UILabel *Latitudelabel;8@property (Weak, nonatomic) Iboutlet UILabel *Detaillabel;9 Ten @end One A @implemen
, the interface will return to the corresponding provincial urban street information. Baidu Map interface returned is a string of JSON data, we can according to the needs of the information needed to display to Div#baidu_geo. Note that the jquery library is used here, and the jquery library file needs to be loaded first.function Showposition (position) {var LatLon = position.coords.latitude+ ', ' +position.coords.longitude;//baiduvar url = "Baidu.com/geocode
geographic location information such as street and house number.On the page, we first define the p where the geographical location is to be displayed, and define id # baidu_geo and id # google_geo respectively. We only need to modify the key function showPosition (). First, let's look at Baidu Map interface interaction. we send the latitude and longitude information to Baidu Map interface via Ajax, and the interface will return the corresponding provincial and municipal street information. The
optimization library
JShrink-a JavaScript compression library
Puli-a database that detects the absolute path of a resource
Geolocation)
Database that uses the latitude and longitude encoding address
GeoCoder-a geocode Library
GeoTools-a database related to a geographic tool
PHPGeo-a simple geographic database
GeoJSON-implementation of a GeoJSON
Date and Time)
Databases that process
a covering marker. Refer to Baidu documentation.// Add a marker
// Construct the Marker iconBitmapDescriptor bitmap = BitmapDescriptorFactory. FromResource (drawable );// Construct a MarkerOption to add a Marker to a mapOverlayOptions option = new MarkerOptions (). Position (point). Icon (bitmap );// Add a Marker to the map and display itMBaiduMap. addOverlay (option );D. Add a line. pts is a collection List
OverlayOptions polylineOption = new PolylineOptions (). Points (pts). width (5). color
request, get the current city name, for example: http://maps.googleapis.com/maps/api/geocode/json? Latlng = 22.5329294, 114.019329 sensor = true. We can replace the latlng parameter with the geographical coordinates obtained by the mobile phone to obtain the city name. Although it is more troublesome than the Baidu jar package, but it is also the most primitive method. When we access this website through the webpage, we find that a lot of data is re
Showposition (). First look at Baidu map interface interaction, we will latitude and longitude information via Ajax way to send to Baidu map interface, the interface will return the corresponding provincial urban street information. Baidu Map Interface Returns a string of JSON data, we can according to the needs of the information needed to show to Div#baidu_geo. Note that the jquery library is used here, and the jquery library file needs to be loaded first.
function Showposition (p
provincial and municipal information, and even detailed geographic location information such as street and house number.
On the page, we first define the p where the geographical location is to be displayed, and define id # baidu_geo and id # google_geo respectively. We only need to modify the key function showPosition (). First, let's look at Baidu map interface interaction. We send the latitude and longitude information to Baidu map interface via Ajax, and the interface will return the corres
query classAMap.event.addListener (Auto, "select", select);//register for monitoring, will be triggered when a record is selectedfunction Select (e) {Placesearch.setcity (E.poi.adcode);Placesearch.search (E.poi.name); Keyword query Queryvar poiarr = E.poi.name;Localstorage.setitem ("Name", Json.stringify (Poiarr));var geocoder = new Amap.geocoder ({radius:1000//Range, default: 500});Geocoder.getlocation (Json.parse (Localstorage.getitem ("name")), fu
Method One:Using Geopy Package: https://github.com/geopy/geopy (only accurate to town, concrete streets no results returned) from Import Nominatim # using geopy queries def Geocoden (address): GPS=nominatim () location =Gps.geocode (address) return Location.longitude,location.latitudeMethod Two:Use the Api,key map or Baidu map to apply for replacement on the official website.ImportRequests#using the high-de APIdefgeocodeg (address): par= {'Address': Address,'Key':'cb649a25c1f81c1451adb
the map interface, will return to the user's geographical location, including provincial urban information, and even the streets, building and other detailed geographical information.
We first define the div for the location of the page, defining Id#baidu_geo and Id#google_geo respectively. We just need to modify the key function Showposition (). First look at Baidu map interface interaction, we will latitude and longitude information via Ajax way to send to Baidu map interface, the interface
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.