gisviewer-vue3-arcgis
v1.0.191
Published
在应用中引入私服的包, 项目根目录下 新建文件 .npmrc 在 .npmrc 中对包源进行配置:
Downloads
683
Readme
给项目设置包作用域
在应用中引入私服的包, 项目根目录下 新建文件 .npmrc 在 .npmrc 中对包源进行配置:
@yzc:registry=http://121.4.178.108:10023/
Install
$ npm install @yzc/gisviewer-vue3-arcgis
Using bower:
$ bower install @yzc/gisviewer-vue3-arcgis
Using yarn:
$ yarn add @yzc/gisviewer-vue3-arcgis
Using pnpm:
$ pnpm add @yzc/gisviewer-vue3-arcgis
其它
可使用 nrm 管理本地 包地址
nrm ls
nrm add registry http://121.4.178.108:10023/
nrm use registry
Quick Start
import Vue from "vue";
import gisviewerVue3Arcgis from "@yzc/gisviewer-vue3-arcgis";
const app = createApp(App);
app.use(gisviewerVue3Arcgis, {
openDriveServer: "http://192.168.0.205:28081/", //openDriveServer地址
ws: "ws://192.168.0.208:28086/", //ws 服务地址
assetsRoot: "http://192.168.0.205:8081/GisViewerAssets", //静态资源地址
});
app.mount("#app");
使用
<template>
<div class="index">
<gis-map :config="GIS_CONFIG_PATH" ref="gisMapRef" @map-loaded="mapLoaded"
@marker-click="markerClicked"></gis-map>
</div>
</template>
<script setup lang="ts">
import { GisMap } from "@yzc/gisviewer-vue3-arcgis";
const GIS_CONFIG_PATH: string = "./config/HuZhou/gis-config.json";
const gisMapRef = ref<InstanceType<typeof GisMap> | null>(null);
const jobId=''
const wshost=''
const haldclick = () => {
gisMapRef.value?.connectCarFlow(wshost + "crossdt-api/websocket/pw_rt_trace/" + jobId,
{
showVehiclePlate: false
});
};
const mapLoaded=()=>{
}
const markerClicked=()=>{
}
</script>
<style lang="scss" scoped>
</style>