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

rrwvuemap

v1.0.14

Published

Map control using Vue and OpenLayers

Downloads

49

Readme

Vue Map Library

Developin the Library

Initial Setup

Install latest version of Node JS. This includes NPM.

The following command line was run: npm create vue@latest vue-map-library.

This command line presents the developer with options to install various plugins like TypeScript, testing, linting and prettier. Use spacebar or arrow keys in the commandline wizard to toggle Yes and No options. The application makes use of Vite for testing and configuration.

Compile and Hot-Reload for Development

Run npm run dev.

Type-Check, Compile and Minify for Production

Run npm run build to compile for distribution.

Run Unit Tests with Vitest

Run npm run test:unit to run tests.

Lint with ESLint

Run npm run lint to show any compiler and syntax errors.

Hashed URLs

Default behaviour is to not use hashed URLs in the Router definition. Main disadvantage is that links to new 'pages' go to the server and back again, essentially reloading the app.

This app has since been mofified to use createWebHashHistory instead of default createWebHistory in the Router definition page.

As a result, the URL for a page becomes http://localhost:5173/#/page instead of http://localhost:5173/page and the URL for home becomes http://localhost:5173/#/ instead of http://localhost:5173/.

Peer Dependencies

Make sure any dependencies are placed into the peer dependencies section so that the consuming application doesn't automatically install them as dependencies.

Linking the Library

Linking by file

Enter "rrwvuemap": "file:../VueMapLibrary" instead of "rrwvuemap: "?.?.?" in the dependencies section of the package.json file to load the package with reference to a file. Run npm install afterwards to update it.

Linking by NPM Link

Enter npm link in the terminal of this library.

Enter npm link rrwvuemap in the terminal of the consuming NodeJS project.

To unlink: type npm unlink rrwvuemap in the terminal of the consuming NodeJS project.

Publishing to NPM

The first time:

Register with npm in https://www.npmjs.com/. Then follow https://registry.npmjs.org/ to register PC against your new profile.

Username: richardrobinwebster Password: R!chardWebster01

You need to authorize this machine using npm adduser.

Find your NPM package in https://www.npmjs.com/package/rrwvuemap; alternatively search for it in https://www.npmjs.com.

Then login on https://registry.npmjs.org/ to be able to update the package online.

On the command line, in the package root directory, run the following commands:

First run npm version patch to increment the version, then run npm publish to publish it. Your browser will need to be logged in to https://registry.npmjs.org/ in order to do this. It will prompt you to do so if you are not logged in. It authorises your PC against the profile.

Don't forget to commit GIT after doing this to commit the newly published verion.

Developing the Consumer Application

Run npm install rrwvuemap for a final version or link the methods mentioned above for debugging.

Make sure Vue 3 is installed.

import { MapComponent } from "rrwvuemap";

<MapComponent />

Release Notes

Version 1.0.4

  • MapComponent is the only exported component at the moment.
  • It has a single map layer: Open Street Map.
  • It has a single projection, default projection Web Mercator, EPSG 3857.
  • Input properties for MapComponent are:
    • Longitude and latitude for initial center point. This will facilitate geolocation by the consuming application.
    • Height, in pixels or calculated pixels (calc() method in stylesheets).
    • Initial zoom level.
    • Scalebar control, not confugurable.
    • Incorporation of stylesheets from Open Layers (ol.css).
    • Added new event: map-extent-changed.
    • Added new event: map-cursor-move.

Version 1.0.5

  • Renamed MapComponent to MapControl.
  • Added StatusbarControl control.
  • Added IntegratedControl that replaces MapControl as the exported control.
  • Modified emitted events to be:
    • view-changed
    • map-cursor-move
    • map-loaded
  • Added many props to the IntegratedControl regarding the status bar.

Version 1.0.6

  • Changed many props into one big structure.
  • Exporting types and components in export.ts file.
  • Cache layers in a singleton service for re-use by map when it is re-created.
  • Added first hardcoded feature layer.
  • Re-introduced map width property.
  • Re-distributed code into services.
  • Removed IntegratedControl; all controls inside map.
  • Added buttonbar, ButtonbarControl, and geolocation button.
  • Removed emitted events due to redundancy.
  • Added functionality to label vectors and declutter labels.
  • Added functionality to load polygons, polylines and point vector layers.

Version 1.0.14

  • Attrbutions and legends. Legend graphics dynamic for layers with feature style functions.
  • Labels unique to a map.
  • Layers and map have auto unique IDs.
  • Added min and max resolution for layers.