当前位置:网站首页>Gaode map
Gaode map
2022-07-24 09:55:00 【A sack kitten】
Positioning with Gaud map :
I won't say much about the preparatory work , Is to register a login account to get key value , And then in main.js In the introduction
// Gould map
import AMap from ‘vue-amap’;
Vue.use(AMap);
// initialization vue-amap
AMap.initAMapApiLoader({
// Godly key
key: ‘ Applied key’,
// Plug in collection ( Plug ins are introduced on demand )
plugin: [‘AMap.Autocomplete’, ‘AMap.PlaceSearch’, ‘AMap.Scale’, ‘AMap.OverView’, ‘AMap.ToolBar’, ‘AMap.MapType’, ‘AMap.PolyEditor’, ‘AMap.CircleEditor’]
});
And then use , All I need to get is positioning , So for ui Don't do too much trimming .
var that = this;
var mapObj = new AMap.Map('mapDemo');
mapObj.plugin('AMap.Geolocation', function () {
var geolocation = new AMap.Geolocation({
enableHighAccuracy: true,// Whether to use high precision positioning , Default :true
timeout: 10000, // exceed 10 Stop positioning in seconds , Default : infinity
maximumAge: 0, // Locate the result cache 0 millisecond , Default :0
convert: true, // Auto offset coordinates , The offset coordinates are Gaud coordinates , Default :true
showButton: true, // Show the positioning button , Default :true
buttonPosition: 'LB', // Positioning button docking position , Default :'LB', The lower left corner
buttonOffset: new AMap.Pixel(10, 20),// The offset of the positioning button from the set docking position , Default :Pixel(10, 20)
showMarker: true, // After the positioning is successful, the point mark will be displayed at the location , Default :true
showCircle: true, // After successful positioning, circle is used to indicate the positioning accuracy range , Default :true
panToLocation: true, // After successful positioning, take the location as the center of the map , Default :true
zoomToAccuracy:true // After successful positioning, adjust the scope of the map to make the location and accuracy range visible , Default :false
});
mapObj.addControl(geolocation);
geolocation.getCityInfo(function(status,result){
that.adress = result.country + result.province + result.city;
})
});
adress Is the final address , The format is Shenzhen, Guangdong Province, the people's Republic of China .
Gaud open platform :https://lbs.amap.com/
Locate the document :https://lbs.amap.com/api/javascript-api/guide/services/geolocation
边栏推荐
- Raspberry Pie:: no space left on device
- Openstack network neutron knowledge point "openstack"
- Lung CT segmentation challenge 2017 dataset download and description
- Compilation and linking of programs
- 详解LinkedList
- Installation UMI tutorial (error reporting and solutions)
- [MySQL] - deep understanding of index
- Arduino drive Lora module master node
- Raspberry Pie: the serial port has been unable to read the information sent by the upper computer
- Can the "self-help master" who has survived the economic crisis twice continue to laugh this time?
猜你喜欢

Compilation and linking of programs
![Calculate CPU utilization [Prometheus]](/img/00/d9f297e3013cabbf3d41be58105fc7.png)
Calculate CPU utilization [Prometheus]
![Learn more about the synchronized lock upgrade process [concurrent programming]](/img/d8/a74d0e151aa16d4a02566a8a822285.png)
Learn more about the synchronized lock upgrade process [concurrent programming]

Raspberry Pie: /bin/sh: 1: bison: not found

Linux deployment mysql8.0

An article takes you to understand the operation of C language files in simple terms
![[STM32 learning] (15) STM32 realizes DHT11 temperature and humidity acquisition and display](/img/f2/6fcd4b2e747b4ceb52a52eda0c1af4.png)
[STM32 learning] (15) STM32 realizes DHT11 temperature and humidity acquisition and display

ASI-20220222-Implicit PendingIntent

配置系统环境变量的时候误删了Path怎么办?

Leetcode skimming: dynamic planning 03 (climb stairs with minimum cost)
随机推荐
NVIDIA set persistent mode
Detailed explanation of uninstalling MySQL completely under Linux
IdentityServer4入门
PHP debugging tool - how to install and use firephp
Arduino serial port information reading and output
note: expected ‘void * (***)(void ***)’ but argument is of type ‘void (*)(void *)’
Embedded development: Tools - optimizing firmware using DRT
Scala learning: why emphasize immutable objects?
2022 trusted cloud authoritative assessment released: Tianyi cloud has obtained ten certifications and five best practices
Redis configuration serialization
[don't bother with reinforcement learning] video notes (I) 2. Summary of reinforcement learning methods
Gin framework uses session and redis to realize distributed session & Gorm operation mysql
Value on the object Z rotation synchronization panel in unity
Detailed LinkedList
Installation UMI tutorial (error reporting and solutions)
Boundless dialogue | participate in the live broadcast on July 25 and win the prize
Development history of the first commercial humanoid biped robot in China
JS 84*148=b6a8 how many decimal places can you make both sides equal
JS string method
Spark Learning: a form of association in a distributed environment?