npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

openlayers-map-vue2

v1.0.6

Published

A Vue component for integrating OpenLayers map.

Downloads

427

Readme

OpenlayersMap

OpenlayersMap 是一个 Vue 组件,用于集成 OpenLayers 地图,并且支持 element-ui 组件库。该组件库可以作为插件安装到 Vue 项目中,或者单独使用。

安装

首先,确保你的项目已经安装了 vueelement-ui

npm install vue element-ui --save

然后,安装 openlayers-map 包:

npm install openlayers-map --save

使用

1. 全局注册为 Vue 插件

你可以将 OpenlayersMap 组件库作为 Vue 插件全局注册:

import Vue from "vue";
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";

import OpenlayersMapPlugin from "openlayers-map";

Vue.use(ElementUI);
Vue.use(OpenlayersMapPlugin);

new Vue({
  render: (h) => h(App),
}).$mount("#app");

2. 单独使用组件

你也可以在需要的地方单独引入并注册 OpenlayersMap 组件:

<template>
  <div class="water-resources">
    <OpenlayersMap />
  </div>
</template>

<script>
import { OpenlayersMap } from "openlayers-map";

export default {
  components: {
    OpenlayersMap,
  },
};
</script>

依赖

OpenlayersMap 组件库依赖以下库:

  • vue: Vue.js 框架
  • element-ui: 饿了么前端团队开发的基于 Vue 2.0 的组件库
  • openlayers: 开源的地理信息系统(GIS)库,用于显示地图数据

开发和构建

本地开发

克隆项目后,你可以在本地进行开发:

npm install
npm run dev

构建发布

当你准备发布你的组件库时,可以运行以下命令进行构建:

npm run build

这将会生成打包文件,并输出到 dist 目录。

贡献

欢迎任何形式的贡献!请提交 Pull Request 或报告 Issue 来帮助我们改进。

许可证

ISC

总结

  • 安装:介绍如何安装和使用你的包。
  • 使用方法:提供全局注册和单独使用的示例代码。
  • 依赖:列出你的包所依赖的库。
  • 开发和构建:提供开发和构建的指导。
  • 贡献:鼓励其他开发者参与到项目中来。
  • 许可证:声明你的项目的许可证。