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

longdo-map-v3-vue

v1.0.1

Published

Longdo Map (API v3) component for Vue.js

Downloads

5

Readme

Longdo Map Logo

longdo-map-v3-vue

Longdo Map (API v3) component for Vue.js

npm npm npm

Table of Contents

Getting Started

Requirement

The current version of Longdo Map Vue does not support Vue 3.

Installation

You can easily install by using npm

npm i longdo-map-v3-vue

Usage

First, you need to get a Longdo Map API key.

Then, after you have Longdo Map API key and component installed, you need to register it to your Vue project.

There are two ways of registering component:

Register component globally

This is a recommended way of registering component

In your main.js or similar file:

import Vue from 'vue'
import LongdoMap from 'longdo-map-v3-vue'

Vue.use(LongdoMap, {
    load: {
        apiKey: 'YOUR_LONGDO_MAP_API_KEY'
    }
})

Then you can use <longdo-map/> in your component template.

<template>
    <longdo-map/>
</template>

Register locally in your component

In your component file, for example Foo.vue:

<template>
    <longdo-map/>
</template>
import { LongdoMap } from 'longdo-map-v3-vue'
LongdoMap.init({ apiKey: 'YOUR_LONGDO_MAP_API_KEY' })

export default {
  name: 'Foo',
  components: {
      LongdoMap
  }
}

You can import more components if you want, for example:

import { LongdoMap, LongdoMapMarker } from 'longdo-map-v3-vue'

Examples

Add a polygon to Longdo Map:

<template>
    <longdo-map>
        <longdo-map-polygon
            :location="locationList"
            :lineWidth="2"
            :lineColor="'rgba(0, 0, 0, 1)'"
            :fillColor="'rgba(255, 0, 0, 0.4)'"
        />
    </longdo-map>
</template>
export default {
    data() {
        return {
            locationList: [
                { lon: 99, lat: 14 },
                { lon: 100, lat: 13 },
                { lon: 102, lat: 13 },
                { lon: 103, lat: 14 }
            ]
        }
    }
}

Add multiple markers to Longdo Map:

<template>
    <longdo-map :zoom="10" :lastView="false">
        <longdo-map-marker
            v-for="(item, i) in markers"
            :key="i"
            :location="item.location"
            :title="item.title"
            :detail="item.detail"
        />
    </longdo-map>
</template>

Using Longdo Map object:

<template>
    <longdo-map @load="loadMap">
        <longdo-map-marker @add="addMarker" :location="{ lon: 99, lat: 14 }" />
    </longdo-map>
</template>
export default {
    methods: {
        loadMap (map) {
            map.Layers.setBase(longdo.Layers.NORMAL)
        },
        addMarker (marker) {
            console.log(marker.location())
        }
    }
}

Components

Map

  • Props
  • Event: @load="Function(object)"
<longdo-map :zoom="10" :lastView="false" />

Overlay

  • Props
  • Event: @add="Function(object)"
<longdo-map>
    <longdo-map-marker :location="{ lon: 99, lat: 14 }" :title="'Home'" :detail="'My home'" />
</longdo-map>

Geometry

longdo-map-dot, longdo-map-circle, longdo-map-rectangle,

longdo-map-polyline, longdo-map-polycurve, longdo-map-polygon

  • Props
  • Event: @add="Function(object)"
<longdo-map>
    <longdo-map-polygon
        :location="[{ lon: 100.123, lat: 13.579 }, ...]"
        :lineWidth="2"
        :lineColor="'rgba(0, 0, 0, 1)'"
        :fillColor="'rgba(255, 0, 0, 0.4)'"
    />
</longdo-map>

Menu Bar

  • Props
  • Event: @add="Function(object)"
  • Event: @change="Function(currentMenuItem: Object, lastMenuItem: Object)"
<longdo-map>
    <longdo-map-menu-bar :button="[{ label: 'first', value: 1 }, { label: 'second', value: 2 }]" />
</longdo-map>

*** support button type only

Custom Control

  • Props
  • Event: @add="Function(object)"
<longdo-map>
    <longdo-map-custom-control :html="'<button>button</button>'" />
</longdo-map>

Custom UI

  • Props: vertical, horizontal ('top', 'right', 'bottom', 'left', 'center')
<longdo-map>
    <longdo-map-custom-ui :vertical="'bottom'" :horizontal="'center'">
        <div>Longdo Map</div>
    </longdo-map-custom-ui>
</longdo-map>

Documentation

Community

References