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"
information through the Ajax way to the Google Map interface, the interface will return the corresponding provincial urban street details. The Google Maps interface returns a string of JSON data, which is more detailed than the return of the Baidu map interface, and we can display the required information to Div#google_geo according to demand.function Showposition (position) {var LatLon = position.coords.latitude+ ', ' +position.coords.longitude;Googlevar url = ' http://maps.google.cn/maps/api/
Recently, the project needs to query the specific address and region by latitude, through the query network resources, found that most of the provided to get the specific address of the region or the name of the city is not very good grasp; I got myself A:
Copy Code code as follows:
WebClient Client Objects
WebClient client = new WebClient ();
String url = "http://maps.google.com/maps/api/geocode/xml?latlng=" + Latitude + "," + Longitude
map Managed-bean "ImageFormat" attribute to "PNG".
Context-attributes.xml:
This simple application has only one map control, so the managed-bean of only one map control needs to be created. If you need to add controls like "Toc" and "Overview", you will also create these anaged-beans in Context-attributes.xml.
Ags-functionalities.xml: In Ags-functionalities.xml, you created Managed-beans for the different features of the ArcGIS server:
Agsmap: A managed-bean that represents the map funct
We can use the Geocodemodel in the Ubuntu SDK to GeoCode. For example, we give a place name, through the Geocodemodel to query the location of the specific information, such as longitude dimension, street information and so on. In today's article, we use a simple routine to show how to query a location.
As described in our API documentation:
Geocodemodel {
Id:geocodemodel
plugin:plugin
autoupdate:false
onstatuscha
longitude, and then draw in the map. The geocedable traits are defined as follows:
?phptrait geocodable {/** @var string */protected $address;/** @var \geocoder\ Geocoder */protected $geocoder,/** @var \geocoderlresult\geocoded */protected $geocoderResult;p ublic function Setgeocoder (\geocoder\geocoderintertace $geocoder) {$this->geocoder = $geocoder;} Public Function setaddress ($address) {$this->address = $address;} Public Function Getlatitude () {if (Isset ($this->geocoderresult) = = = Fals
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.