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

threelibre-plugin

v0.0.2

Published

A Three.js plugin for MapLibre GL JS, using the CustomLayerInterface feature. Provides convenient methods to manage objects in lnglat coordinates, and to synchronize the map and scene cameras.

Downloads

113

Readme

Threelibre

A Three.js plugin for MapLibre GL JS and Azure Maps using the CustomLayerInterface feature. Provides convenient methods to manage objects in lnglat coordinates, and to synchronize the map and scene cameras.


Latest release

Threelibre is available as an npm package

npm i threelibre-plugin

Example

|Models built-in & custom animations |Mouse over/out, Selected, Drag&Drop, Drag&Rotate, Wireframe ---------|----------------------- ||

|Tooltips using altitude|Optimization of camera perspective and depth |----------|------- ||

|Runtime style change|Optimized performance through cache |----------|------- ||

|Customizable FOV|Geojson and Points Extrusions |---------|------- ||

|Sunlight illumination for a given datetime and lnglat|Models built-in shadows and sky layer synced with Sunlight |---------|------- ||


Documentation

All the ThreeLibre Documentation has been completely updated, including all the methods, properties and events implemented in Threebox and objects, but still 'work in progress' adding better documented examples and images to illustrate Threebox capabilities.


Compatibility/Dependencies

  • Three.js 132. (already bundled into the Threebox build). If desired, other versions can be swapped in and rebuilt here, though compatibility is not guaranteed.
  • Maplibre-gl v4.1.3.
  • Azure Maps v2.0.31.

Getting started

You can use threelibre in three different ways.

NPM install

Add threelibre to your project via npm package

npm install threelibre-plugin

Then you will need to import Threebox object in your code. Depending your javascript framework this might be different.

import { Threebox } from 'threelibre-plugin'; 

Depending the framework, wrapper or bundler you ar using, try with this:

import { Threebox } from 'threelibre-plugin/dist/threebox'; 

Use the bundle locally

Download the bundle from dist/threebox.js or dist/threebox.min.js and include it in a <script> tag on your page.
If you want to use styles predefined, add the link to the cascade style sheet, just ensure the src and href attributes are pointing to relative or absolute url path.

<script src="../dist/threebox.js" type="text/javascript"></script>
<link href="../dist/threebox.css" rel="stylesheet" />

Public CDNs

Threebox can be also used from different public CDNs:

unpkg

Despite this CDN admits version, if omitted, it will download always the last one published.

<script src="https://unpkg.com/threelibre-plugin/dist/threebox.min.js" type="text/javascript"></script>
<link href="https://unpkg.com/threelibre-plugin/dist/threebox.css" rel="stylesheet" />

For an specific version (i.e. v0.0.1) use the followin:

<script src="https://unpkg.com/[email protected]/dist/threebox.min.js" type="text/javascript"></script>
<link href="https://unpkg.com/[email protected]/dist/threebox.css" rel="stylesheet" />

Test the samples

Several introductory examples are here.
To run them, create a config.js file with your Mapbox-gl-js access token, alongside and in the format of the template.


Contributing

  • Clone the Github repo.
  • Build the library with npm run build to get the minimized version, or npm run dev to get the development version and rebuild continuously as you develop.
  • Both commands will output a bundle in dist/ folder.

Unit tests

Tests live here.

How to build the project in Visual Studio

Sample to get a full build from scratch for Visual Studio:

  • Install Node.js
  • Clone the repo and open a new Project using main.js
  • Install / Update the packages browserify, tape, ncp, uglyfy, watchify.
  • Right click on the project at the Solution Explorer > Open Node.js Interactive Window:
  • execute .npm [ProjectName] init -y
  • execute .npm [ProjectName] install
  • execute .npm [ProjectName] i
  • execute .npm [ProjectName] run dev or .npm run build