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

@skymapglobal/geometry-input

v1.3.17

Published

Geometry Input component using Vuetify framework.

Downloads

30

Readme

Geometry Input

Geometry Input component using Vuetify framework.

Features

  • Drawer

    • Draw Rectangle (with buffer)
    • Draw Polygon (with buffer)
    • Draw Buffered Line
    • Draw Buffered Point
  • Geocoding

    • Support multiple provider
      • Free: Esri, Open Street Map
      • Commercial: Algolia, Bing, Google, Here, Location IQ, Open Cage
  • Upload

    • Support format
      • GeoJSON (.json, .geojson)
      • Shapefiles (.dbf, .prj, .cpg, .shx)
      • GPX
      • KML, KMZ
      • CSV
      • GML
      • WKT
  • Edit

    • Edit current Geometry as Polygon
  • Download

    • Support format
      • GeoJSON
      • Shapefiles
      • GPX
      • KML
      • CSV
      • GML
      • WKT
  • Tools

    • Simplify
    • Convex
    • Grid
    • BBox
  • Settings

  • Translation using vue-i18n

Install Vuetify

vue add vuetify

Install vue-i18n

vue add i18n

Install

yarn add @skymapglobal/map-drawer @skymapglobal/geometry-input

Usage

Geometry Input Usage

<template>
  <v-app>
    <v-main>
      <Map>
        <BaseMapControl position="top-right" default-base-map="Dark" />

        <MouseCoordinatesControl position="bottom-right" />

        <DrawControl>
          <!-- Needed this GeometryDrawerMapModule for drawing on Map -->
          <GeometryDrawerMapModule />
        </DrawControl>
      </Map>

      <div style="position: absolute; top: 10px; left: 10px; padding: 10px 15px;">
        <GeometryInput
          v-model="myAOI"
          :drawer="geometryInputConfigs.drawer"
          :geocoder="geometryInputConfigs.geocoder"
          :uploader="geometryInputConfigs.uploader"
          :downloader="geometryInputConfigs.downloader"
          :transformer="geometryInputConfigs.transformer"
          :settings="geometryInputConfigs.settings"
          clearable
          filled
          persistent-tool-box
          hide-details
        >
          <template v-slot:tools>
            <v-btn title="Set Sample AOI" icon @click="setSampleAoi">
              <v-icon>{{ icons.mdiShapeRectanglePlus }}</v-icon>
            </v-btn>
          </template>
        </GeometryInput>
      </div>
    </v-main>
  </v-app>
</template>

<script>
import {
  Map,
  BaseMapControl,
  MouseCoordinatesControl
} from "@skymapglobal/map";
import { DrawControl } from "@skymapglobal/map-drawer";

import { GeometryInput, GeometryDrawerMapModule } from "@skymapglobal/geometry-input/GeometryInput.vue";

import { mdiShapeRectanglePlus } from "@mdi/js"

export default {
  name: "App",

  components: {
    Map,
    BaseMapControl,
    GeometryDrawerMapModule,
    DrawControl,
    MouseCoordinatesControl,
    GeometryInput
  },

  data: () => ({
    geometryInputConfigs: {
      drawer: {
        rectangle: true,
        polygon: true,
        line: true,
        point: true
      },
      geocoder: {
        esri: {},
        openStreetMap: {
          polygon_geojson: 1 // Get Polygon GeoJson
        }
      },
      uploader: {
        accept:
          ".geojson, .json, .shp, .shx, .dbf, .prj, .cpg, .kml, .kmz, .gpx, .csv, .gml, .wkt"
      },
      downloader: {
        saveTypes: ["geojson", "gpx", "kml", "shapefile", "csv", "gml", "wkt"]
      },
      transformer: {
        simplify: true,
        convex: true,
        grid: true,
        bbox: true
      },
      settings: {
        reverseGeocoder: {
          email: "[email protected]"
        }
      }
    },

    icons: {
      mdiShapeRectanglePlus
    }
  })
};
</script>

Geometry Geocoder Usage

<template>
  <GeometryGeocoderInput :config="geocoderConfig" @change="(geojson) => {}" />
</template>

<script>
import { GeometryGeocoderInput } from "@skymapglobal/geometry-input"

export default {
  components: {
    GeometryGeocoderInput
  }
}
</script>

Geometry Uploader Usage

<template>
  <GeometryUploaderDialog
    :config="uploaderConfig"
    :visible.sync="dialogVisible"
    @submit="(geojson) => {}"
  />
</template>

<script>
import { GeometryUploaderDialog } from "@skymapglobal/geometry-input"

export default {
  components: {
    GeometryUploaderDialog
  }
}
</script>

Geometry Downloader Usage

<template>
  <GeometryDownloaderDialog
    :geojson="geojson"
    :config="downloaderConfig"
    :visible.sync="dialogVisible"
    @submit="() => {}"
  />
</template>

<script>
import { GeometryDownloaderDialog } from "@skymapglobal/geometry-input"

export default {
  components: {
    GeometryDownloaderDialog
  }
}
</script>

Config

drawer: [Object, Boolean] - Set to false to hide drawer tool

  • rectangle: Boolean - Enable Rectangle Draw Tool
  • polygon: Boolean
  • line: Boolean
  • point: Boolean

NOTE: MUST import GeometryDrawerMapModule and register into the map that want to draw geometry on

geocoder: [Object, Boolean] - Set to false to hide geocoder tool

More detail configs: https://smeijer.github.io/leaflet-geosearch/#providers

  • algolia: Object
  • bing: { key: 'YOUR_BING_KEY', }
  • esri: Object
  • google: { key: 'YOUR_GOOGLE_KEY', }
  • here: { apiKey: 'YOUR_HERE_KEY' }
  • locationIQ: { key: 'YOUR_LOCATIONIQ_KEY' }
  • openCage: { key: 'YOUR_OPENCAGE_KEY', }
  • openStreetMap: { email: '[email protected]' // auth for large number of requests }

uploader: [Object, Boolean] - Set to false to hide geocoder tool

  • accept: String - input accept, support: ".geojson, .json, .shp, .shx, .dbf, .prj, .cpg, .kml, .kmz"

downloader: [Object, Boolean] - Set to false to hide geocoder tool

  • saveTypes: String[] - save types, support: "geojson", "shapefile", "csv", "kml"