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

@south-rd/smarthub-map

v1.0.9

Published

腾讯地图组件

Downloads

2

Readme

smart-map

一款基于腾讯地图 API 开发的 map

本地项目初始化

yarn install

查看例子

yarn dev

组件打包

yarn run lib

基于 elementui,使用响应式处理元素 PC、手机样式

本地开发调试

本地项目 执行组件打包命令

yarn run lib

开启文件链接

yarn link

vue 项目中安装

yarn add @south-rd/smarthub-map

本地项目环境安装本组件

项目链接引用

yarn link @south-rd/smarthub-map

引入组件

import smarthubMap from '@south-rd/smarthub-map'
import '@south-rd/smarthub-map/lib/smarthub-map.css'
Vue.use(smarthubMap)

使用组件

组件名称

<smarthub-map></smarthub-map>

组件参数

<template>
  <div id="app">
    <div class="m">
      <smarthub-map
        ref="map"
        @getPos="getPos"
        
        @position-information="positionInformation"
        :geometriesCenter="geometriesCenter"
        :markerLayerOnly="markerLayerOnly"
        :markerLayerLine="markerLayerLine"
      />
    </div>

    <button style="position: fixed; top: 0; left: 0" @click="query">
      获取距离
    </button>
  </div>
</template>

<script>
export default {
  name: "App",
  data() {
    return {
      // geometries: 2000, //可监控区域半径
      position: {
        zoom: 13, //设置地图缩放级别
        pitch: 15, //设置俯仰角
        rotation: 45, //设置地图旋转角度
        setPosition: "bottomRight", //topRight上面//bottomRight下面//不存在则不显示
        mayApp: "",
        city: "",
      },
      markerLayerOnly: {
        //个人定位标注
        //个人定位
        // width: 25,
        // height: 35,
        // anchor: { x: 16, y: 32 },
        src:
          "https://mapapi.qq.com/web/lbs/javascriptGL/demo/img/markerDefault.png",
      },
      markerLayerLine: {
        //可进行多点标注
        // width: 25,
        // height: 35,
        // anchor: { x: 16, y: 32 },
        // src:
        //   "https://mapapi.qq.com/web/lbs/javascriptGL/demo/img/markerDefault.png",
        // positionList: [
        //   { longitude: 31.337297, latitude: 121.48216 },
        //   { longitude: 31.25592, latitude: 121.491887 },
        // ],
      },
      geometriesCenter: {
        //设置监控区域毕传
        //设置可监控地点中心坐标
        longitude: 118.655297,
        latitude: 32.059984,
        // src:''
      },
      geolocation: null,
    };
  },
  mounted() {},
  methods: {
    // fatherMethod(res) {
    //   console.log("app", res);
    //   //参考https://lbs.qq.com/webDemoCenter/glAPI/glMap/createMap调用方法
    //   //例如 this.map.getControl(),new window.TMap.Map()
    //   // console.log("扩展方法");
    //   //初始化marker图层
    // },

    getPos(val) {
      //点击获取当前点击地图位置坐标
      console.log("坐标", val);
    },
    positionInformation(res) {
      //定位反回位置信息
      console.log(res);
    },
    //////this.$refs.map.showMarkers()自适应显示多个标注点
    // ///// this.$refs.map.getdistance();//获取当前位置距离距离监控区域距离
    // ///// this.$refs.map.changeScale(scale);//地图缩放例如scale:1、2、3等
    query() {
      //获取当前位置距离
      console.log(1112121);
      console.log(this.$refs.map.getdistance());
    },
  },
};
</script>

<style lang="less">
@import url("./css/normal.css");
#app {
  width: 100%;
  height: 100vh;
  .m {
    width: 100%;
    height: 100%;
  }
}
</style>