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

component-map-web

v0.1.18

Published

web端电子地图组件-基于leaflet实现的2D地图效果

Downloads

70

Readme

platMap

快速开始

1、安装组件库

npm install component-map-web -S

2、引用组件库

//全部引入
import "component-map-web/dist/css/index.css"
import platMap from "component-map-web"
Vue.use(platMap)

//按需引入
import "component-map-web/dist/css/mapBasic.css"
import mapBasic from "component-map-web"
Vue.use(mapBasic)

import "component-map-web/dist/css/mapTool.css"
import { mapTool } from "component-map-web"
Vue.use(mapTool)
// 组件内使用
<plt-map-basic :configObj="configObj" ref="basicMap" @mapReady="mapReady">
  <plt-map-tool
    :tools="tools"
    @pointDbclick="pointDbclick"
    @pointClick="pointClick"
  ></plt-map-tool>
</plt-map-basic>
引入 mapBsic 组件,传入地图参数 configObj,并调用组件内 initMap 方法,初始化地图。
 mounted() {
    this.initConfigObj()
    this.$refs.basicMap.initMap(this.configObj)
  },
  methods: {
    initConfigObj() {
      this.configObj = {
        osmUrl: "http://10.20.167.151:8089/map/yantai/{z}/{x}/{y}.png",
        southWest: [37.590442, 121.057361], // 西南角坐标
        northEast: [37.631471, 121.194953], // 东北角左边
        min: 16,
        max: 19,
        mapCenter: [37.60966, 121.128402],
      }
    },
    mapReady(e) {
      this.map = e
    }
  }

mapReady 方法接收地图初始化完成后的 map,在外部使用。

  methods: {
    mapReady(e) {
      this.map = e
    }
  }
组件内部 map 作为全局变量在各个子组件共享。
需要引入的子组件,则在 plt-map-basic 内引入。
mapTool 展示的工具
  data(){
    return{
      tools: ["distance", "area", "markPoint", "markLine", "markArea", "clear"],
    }
  }