当前位置:网站首页>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
边栏推荐
- Compilation and linking of programs
- [STM32 learning] (15) STM32 realizes DHT11 temperature and humidity acquisition and display
- ASI-20220222-Implicit PendingIntent
- Tencent 5g innovation center was established, laying out key directions such as unmanned ports, smart mines and E-sports events
- Anti shake and throttling
- Arduino drive Lora module master node
- Mysql8.0 authorized remote login
- Get the historical quotation data of all stocks
- MySQL query database capacity size
- [robot learning] mechanism kinematics analysis and MATLAB simulation (3D model +word report +matlab program)
猜你喜欢

Raspberry Pie:: no space left on device
![[MySQL] - deep understanding of index](/img/a6/6ca1356fe11bd33ec7362ce7cdc652.png)
[MySQL] - deep understanding of index
![[STM32 learning] (17) STM32 realizes LCD12864 display serial implementation](/img/93/224eaf0bbfff1d38f29e063e6ebfb8.png)
[STM32 learning] (17) STM32 realizes LCD12864 display serial implementation

Compilation and linking of programs

07 Jason module

note: expected ‘void * (***)(void ***)’ but argument is of type ‘void (*)(void *)’
![[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

Add SSH key to bitbucket

Write a simple memo using localstorage
![[STM32 learning] (6) use of serial port 1 (usart1)](/img/b1/430d3501a99e46958c066f7fd7eee9.png)
[STM32 learning] (6) use of serial port 1 (usart1)
随机推荐
Color recognition of regions of interest in pictures and videos based on OpenCV
Raspberry Pie: [failed] failed to start /etc/rc local Compatibility.
[note] what is kernel / user space? Let's start with how the CPU runs the program
配置系统环境变量的时候误删了Path怎么办?
Vscode failed to use SSH Remote Connection (and a collection of other problems)
What are the 6% annualized products?
Centos7 install mysql8.0
[STM32 learning] (6) use of serial port 1 (usart1)
Add SSH key to bitbucket
Installation UMI tutorial (error reporting and solutions)
error: field ‘XXX’ declared as a function
note: expected ‘void * (***)(void ***)’ but argument is of type ‘void (*)(void *)’
Common evaluation indexes of medical image segmentation
What is the cloud native mid platform business architecture?
Reading makes people improve my list
Can the "self-help master" who has survived the economic crisis twice continue to laugh this time?
Calculate CPU utilization [Prometheus]
Trie tree template 2
MySQL status view qps/tps/ cache hit rate view
财务数字化转型