1.3.0 • Published 11 months ago

at-gis v1.3.0

Weekly downloads
12
License
MIT
Repository
-
Last release
11 months ago

at-gis


at-gis 基于 Vue.js 2.0 的前端组件库,目前只有GisHome一个组件,方便Vue框架通过GisHome嵌入安图二三维一体化平台,也支持嵌入onemapV4.0、onemapV5.0、AtThree,此时组件需要指定 project-name(仅公司内部使用)。

使用 npm 安装

npm install at-gis

全局注册组件

可以在项目的入口文件中引入所有组件或所需组件

main.js

import ATGIS from 'at-gis' 

Vue.use(ATGIS)

局部注册并使用组件

嵌入二三维一体化(webgis)

<template>
    <gis-home :url="url" @gis-call="gisCall" ref="gisHome"></gis-home>
</template>

嵌入onemapV4.0或onemapV5.0,需要指定project-name属性为"OneMap4JS"

<template>
    <gis-home :url="url" @gis-call="gisCall" ref="gisHome" project-name="OneMap4JS"></gis-home>
</template>

嵌入AtThree,需要指定project-name属性为"at-three"

<template>
    <gis-home :url="url" @gis-call="gisCall" ref="gisHome" project-name="at-three"></gis-home>
</template>
import { GisHome } from 'at-gis'

export default {

    components: {
        GisHome
    },
    data: function () {
        return {
            url: 'http://localhost:8081/WebMap/map'
        }
    },
    methods: {
        /**
         * 监听图形事件
         * type:事件名
         * requstInfo:请求信息
         * data:数据
         */
        gisCall({type, requstInfo, data}) {
            console.log(type, requstInfo, data)
        },
        /**
         *调用图形接口示例
         */
        callGis() {
            let obj = {
                requstInfo: {
                    sendId: '1',//同一页面请求标识
                },//请求页面的信息,回传时,会将该对象直接返回
                type: 0,//接口类型,-1:初始化类,0:功能接口类
                param: {
                    /**
                     * 显示图层,同时是否需要关闭已经显示(非底图)的其他图层
                     * 支持模式:2D、3D
                     * @param layers,要显示的图层组
                     * @param closeOther,是否关闭其他非底图图层(默认false)
                     */
                    visibleLayers: {
                        layers: ['gm-scene-1'], closeOther: false
                    }
                }
            }
            this.$refs.gisHome.callGis(obj)
        }
    }
}
1.3.0

11 months ago

1.2.5

1 year ago

1.2.4

1 year ago

1.2.3

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.0

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago