In the last few chapters we studied the use of the Baidu Map SDK, although not difficult but the configuration is also quite cumbersome, now the gold LBS open platform launched a map component based on HTML5, we can use the URL by WebView directly to get the request can be achieved location labeling, route planning, Peripheral search function, greatly simplifies our workload, and do not need to import any files, the following for you to introduce.
First step: Apply key
Same as Baidu map still need to apply for a key, but the application process is very simple.
Website: http://lbs.amap.com
1. Enter the name of the application.
2. Select JavaScript API
3. Click to get key
Step Two: Configure URLs
Function 1: Position callout
Example description
Http://m.amap.com/navi/?dest=121.442946,37.468676&destName= Jerry Education &hiderouteicon=1&key= (the key you applied for)
Parameter description:
:
Function 2: Route planning
Example description
Http://m.amap.com/navi/?start=121.442946,37.468676&dest=121.447967,37.464418&destName= a driving route &key= ( The key you requested)
Parameter description:
Function 3: Peripheral Search
Example description
Http://m.amap.com/around/?locations=121.442946,37.468676&keywords= Gourmet, KTV, bus stop &defaultIndex=3& Defaultview=map&searchradius=5000&key= (the key you requested)
Parameter description:
:
finally because we are using WebView to load URL , do not forget to join the Access network permissions :
<android:name= "Android.permission.INTERNET"></ Uses-permission>
It's all over here, isn't it super simple, because it's not only supported by the URL to Android and iOS but also on the PC, so try it.
Jerry Education
Source:http://www.cnblogs.com/jerehedu/
Copyright Notice: The copyright of this article belongs to cigarettes DeskJerry EducationSection Technology Co., Ltd. and blog Park are shared, welcome reprint, but without the consent of the author must retain this paragraph, and in the article page obvious location to the original link, otherwise reserves the right to pursue legal responsibility.
Technical Consultation:
Gold Map Js-api (super simple get new skill √)