1.1.1 • Published 4 years ago

ha-map v1.1.1

Weekly downloads
2
License
MIT
Repository
-
Last release
4 years ago

地图

演示案例:

1.创建一个vue.js项目并启动。

npm install -g @vue/cli @vue/cli-service-global' 
npm run dev

2.在入口文件 main.js中引入组件。

import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import Map from 'csdc-map';

Vue.use(ElementUI);
Vue.use(Map);

3.在index.html中引入地图api。(这里需要替换成正式申请key,此key只用来测试)

  <script src='http://webapi.amap.com/maps?v=1.4.11&key=7ab53b28352e55dc5754699add0ad862'></script>
  <script src="http://webapi.amap.com/ui/1.0/main.js?v=1.0.11"></script>

4.在template中添加DOM结构。

  <cs-map v-model="obj" :lnglat="lnglat"></cs-map>

5.在script中定义数据与编写逻辑。

export default {
  data() {
    return {
      obj: null,
      lnglat: {
        P: 39.925923,
        R: 116.40265299999999
      }
    };
  }
};

6.在style中编写CSS。

.container {
    width: 100%;
    height: 100%;
  }
1.1.1

4 years ago

0.0.1

4 years ago

1.1.0

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago