1.0.4 • Published 1 year ago

vuleaflet v1.0.4

Weekly downloads
-
License
-
Repository
github
Last release
1 year ago

简介:

vue3 版本的 leaflet 组件, leaflet 版本基于 @1.9.3

安装
npm i vuleaflet -S
使用

main.js中引入并全局注册

import Vuleaflet from 'vuleaflet';
import 'vuleaflet/lib/style.css';

app.use(Vuleaflet);

在需要使用的组件中使用

<script setup>
const onReady = (mapInstance) => {
	console.log(mapInstance);
	console.log('L', L);
};
</script>

<template>
	<div class="wrapper">
		<VuLeaflet @onReady="onReady" />
	</div>
</template>

<style scoped>
.wrapper {
	width: 1200px;
	height: 400px;
	margin: 100px auto;
}
</style>
属性
属性名类型默认值说明
zoomNumber5地图缩放级别
centerArray | Object{ lat: 36.58, lng: 98.97 }地图中心点
showBaseLayerBooleantrue是否加载地图,默认使用天地图影像
configObject{}其他额外参数,透传 leaflet 初始化参数的 Options 选项
方法
方法名称说明回调参数
onReady底图初始化完成后的回调,第一个参数为地图实例Function(mapInstance)
1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

0.1.0

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago