Function: When the app obtains the user's geographic coordinates, it can know what data the user is currently in that country, province, city, and periphery according to the coordinates.
Principle: Based on Baidu geocoding API implementation, need to first register Baidu Developer, and then apply for Baidu AK (key)Geocoding.class.php
/** * Base coordinates to obtain the country, province, city, and the surrounding data class (using Baidu geocoding API implementation) * Baidu Key acquis
= 0){// Storage longitude and latitudeLng = e. point. lng;Lat = e. point. lat;// Draw points on the mapVar marker = new BMap. Marker (new BMap. Point (lng, lat); // create annotationMap. addOverlay (marker );Marker. enableDragging (); // dragVar gc = new BMap. Geocoder ();// Obtain the address data addressVar pt = e. point;Gc. getLocation (pt, function (rs ){Var addComp = rs. addressComponents;Address = addComp. province + addComp. city + addComp. di
as that of the 1st message types. corresponding processing is performed based on the longitude and latitude.
public String getGeoCode(String query) throws ClientProtocolException, IOException{ HttpClient httpClient = new DefaultHttpClient(); String url = geoCodeRequestUrl(query); logger.log(Level.INFO, url); HttpGet httpget = new HttpGet(url); ResponseHandler
responseHandler = new BasicResponseHandler(); String resp
This article mainly introduces the information about simple examples for map locating of applets, and attaches the instance code and implementation, for more information about how to locate the instance code on the map of a small program, see the following article.
Map location for applet development.
It wasn't long before the mini-program was published. I learned the content for future development and wanted to lag behind others. here is a simple example of the mini-program. you can refer to i
Baidu's latitude and longitude information, for example, "lat: 31.325152, lng: 120.558957 "the result of Reverse Address Resolution is" No. 318, Tayuan Road, Huqiu district, Suzhou city, Jiangsu province ".
Code:
Page ({data: {city: ''}, onLoad: function (options) {this. loadInfo () ;}, loadInfo: function () {var page = this wx. getLocation ({type: 'wgs84 ', // The default value is wgs84, which returns the gps coordinates. gcj02 returns the coordinates that can be used for wx. coordinates of o
11.1.0.6.0-Production on Thu Aug 27 02:26:03 2009Copyright (c) 1982,200 7, Oracle. All rights reserved.Connected:Oracle Database 11g Enterprise Edition Release 11.1.0.6.0-ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL> show user;USER is "DBSNMP"
Username
Password
Description
See Also
CTXSYS
CTXSYS
The Oracle Text account
Oracle Text Reference
DBSNMP
DBSNMP
The account used by the Management Agent component of Oracle Enterprise Manager to monitor
Introduced two frames, encoded as attributes, after initialization, after passing in a latitude and longitude, the display map:#import #import@interface Ytmapapplecontroller () @property (nonatomic,strong) Clgeocoder*Geocoder, @end @implementation ytmapapplecontroller- (void) viewdidload {[Super viewdidload]; _geocoder=[[Clgeocoder alloc]init]; [Self location]; //Do any additional setup after loading the view.}-(void) location{[_geocoder reversegeo
: (Cllocationmanager *) Manager didupdatelocations: (Nsarray *) Locations{NSLog (@ "%@", locations);Remove Position ObjectCllocation *location = Locations.firstobject;Remove longitude and latitudecllocationcoordinate2d coordinate = location.coordinate;Print latitude and longitudeNSLog (@ "%f%f", Coordinate.longitude, Coordinate.latitude);}Note : Before iOS7, the system will automatically request authorization, iOS8 and later we need to proactively request authorization, and need to add two addit
var longtitude = 0;var latitude = 0;function Getpostion () {Get latitude and longitude through Baiduvar address = "Specific geographic location";var url = "http://api.map.baidu.com/geocoder/v2/?address=" + address + "output=jsonak= Fg7wxr1vuj0k2nwoo3yxzymdcallback=? ";$.getjson (URL, function (data) { Longtitude = DATA.RESULT.LOCATION.LNG;latitude = Data.result.location.lat;});}Quoting Baidu's resource API, apply for AK to get latitude and longitude (
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 dates and times
Carbon-a simple date an
your own items. mapview by mapview. getoverlays () pair overlay .
Projection:MapviewMediumGPSCoordinate and device coordinate conversion (GeopointAndPoint).
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 also be implemented using this class.
Locationprovider: this class is the abstract class of the positioning pr
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.