How to implement Baidu map display in vuejs project

青灯夜游
Release: 2023-01-11 09:22:07
Original
2404 people have browsed it

Implementation method: 1. Apply for a secret key in "Baidu Map Development Platform"; 2. Use script tags in "index.html" to introduce map links; 3. Put in "APP.vue" Relevant js code implements Baidu map.

How to implement Baidu map display in vuejs project

The operating environment of this tutorial: windows7 system, vue2.9.6 version, DELL G3 computer.

vue uses Baidu map in the project

The first step is to go to the Baidu map development platform http://lbsyun.baidu.com/ Apply for a secret key.

The second step is introduced in the project, as follows

In which index.html stores the map link, the code is as follows

Then implement it in APP.vue, the code is as follows

  
Copy after login

Related recommendations: "vue.js Tutorial"

The above is the detailed content of How to implement Baidu map display in vuejs project. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
vue
source:php.cn
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