Giter VIP home page Giter VIP logo

deck.gl-pmtiles's Introduction

@maticoapp/deck.gl-pmtiles

This repo provides a typed Deck.gl layer and loader for PMTiles data. PMTiles data provides a serverless and compact way to store tile geospatial data. Combined with Deck.gl's rendering, this provides a flexible and powerful way to cheaply manage geospatial data.

Learn more about Brandon Liu's PMTiles and ProtoMaps work.

Breaking Changes

Version 0.0.3 breaks support for V2 tiles. Legacy support will be coming back soon. If you need to use legacy v2 spec PMtiles, use version 0.0.14 of this package.

Roadmap

  • Raster tile support
  • V2 legacy support

Repo Scripts:

yarn build-dev 
// builds the loader/layer for development and listens for changes
    
    
yarn build-prod 
// builds the loader/layer for production
    
yarn dev 
// runs the development server for the loader/layer and the frontend example

Example Usage:

import React from 'react'
import { PMTLayer } from "@maticoapp/deck.gl-pmtiles";
import DeckGL from "@deck.gl/react/typed";

const INITIAL_VIEW_STATE = {
  longitude: -80,
  latitude: 37,
  zoom: 6,
  pitch: 0,
  bearing: 0,
};

const Example: React.FC = () => {
    const Layers = [
        new PMTLayer({
            id: "pmtiles-layer",
            data: "https://protomaps-static.sfo3.digitaloceanspaces.com/mantle-trial.pmtiles",
            getFillColor: [255, 120, 120],
            stroked: true,
            getLineColor: [8, 8, 8],
            lineWidthMinPixels: 1
        })
    ]

    return  <DeckGL
            controller={true}
            layers={layers}
            initialViewState={INITIAL_VIEW_STATE}
            />
}

export default Example

Peer Dependencies

You must also install these packages in your app:

  • deck.gl
  • pmtiles

Other Libraries and References

This repo's code builds on existing work adapted from:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.