How to use uniapp to develop a simple map navigation? This article will provide you with an idea for making a simple map. I hope it will be helpful to you!
Let’s take a look at the renderings first
##Simple map
In the map in Figure 1, you can see that point a is connected to point b, basic information and basic controls (zoom in, zoom out, return to a specified point). Next, we will proceed step by step explain.
Required configuration
needs to be in
app module in manifest.json Configure the map and add the key of the relevant map. If not, you can apply on the relevant developer platform
After configuring this part, you can start using the map Component
Map marker points
To create marker points in uniapp map, you need to use an attribute
markers .
Let’s first take a look at the common attributes of
markers
Name
Description
Type
Required
##id
Mark point id
number
true
latitude
latitude
number
true
longitude
Longitude
number
true
##iconPath
Displayed icon
string
false
callout
Customize the bubble box above the mark point
Object
false
label
Add a label to the marked point
Object
false
For more information, please check:
https://uniapp.dcloud.io/component/map.html
After understanding these, we can use
markers
The attribute creates marker points.
markersThe attribute is of array type, so marker points should be created like this
let appUrl = `qqmap://map/geocoder?coord=${latitude},${longitude}&referer=${腾讯地图key}`
Copy after login
web url
let webUrl = `https://apis.map.qq.com/uri/v1/marker?marker=coord:经度,纬度;title:名称;addr:地址&referer=myapp`
Copy after login
百度
app url
let appUrl = `baidumap://map/marker?location=${latitude},${longitude}&title=${name}&coord_type=gcj02&src=andr.baidu.openAPIdemo`
Copy after login
web url
let webUrl = `http://api.map.baidu.com/marker?location=${latitude},${longitude}&title=${name}&content=${content}&output=html&src=webapp.baidu.openAPIdemo`
The above is the detailed content of Use uniapp to develop a simple map navigation. For more information, please follow other related articles on the PHP Chinese website!
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
How to develop uni-app in VSCode? The following article will share with you a tutorial on developing uni-app in VSCode. This may be the best and most detailed tutorial. Come and take a look!
How to use uniapp to develop a simple map navigation? This article will provide you with an idea for making a simple map. I hope it will be helpful to you!
How to use uniapp to develop a snake game? The following article will take you step by step to implement the Snake game in uniapp. I hope it will be helpful to you!
uni-app interface, global method encapsulation 1. Create an api file in the root directory, create api.js, baseUrl.js and http.js files in the api folder 2.baseUrl.js file code exportdefault"https://XXXX .test03.qcw800.com/api/"3.http.js file code exportfunctionhttps(opts,data){lethttpDefaultOpts={url:opts.url,data:data,method:opts.method
This article brings you relevant knowledge about uniapp, which mainly organizes the related issues of implementing the select-all function of the multi-select box. The reason why the select-all function cannot be implemented is that when the checked field of the checkbox is dynamically modified, the status on the interface can Real-time changes, but the change event of checkbox-group cannot be triggered. Let's take a look at it. I hope it will be helpful to everyone.
This article will guide you step by step in developing a uni-app calendar plug-in, and introduce how the next calendar plug-in is developed from development to release. I hope it will be helpful to you!
This article brings you relevant knowledge about uniapp. It mainly introduces how to use uniapp to make calls and synchronize recording. Friends who are interested should take a look at it. I hope it will be helpful to everyone.
How to implement global message prompts and components in Uniapp? The following article will introduce to you how to implement the Uniapp global message prompt and its components. I hope it will be helpful to you!