Coder Social home page Coder Social logo

kkpan11 / protomaps.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from protomaps/protomaps-leaflet

0.0 1.0 0.0 2.7 MB

Lightweight vector map rendering, labeling and symbology for the web

Home Page: https://protomaps.com/docs/frontends/leaflet

License: BSD 3-Clause "New" or "Revised" License

JavaScript 5.70% TypeScript 91.24% HTML 3.05%

protomaps.js's Introduction

protomaps-leaflet

Vector tile rendering and labeling for Leaflet.

npm Test suite

This project is a complete vector tile renderer - including quality label layout - in as simple as possible of an implementation. It's an alternative to renderers like MapLibre GL JS in a fraction of the size.

New projects starting from scratch should probably use MapLibre GL, but this library is useful as a drop-in replacement for raster basemaps in Leaflet, either using the Protomaps API or PMTiles on your own storage.

Features

  • Render interactive slippy maps with Leaflet integration
  • Supports variable web fonts with multiple weights and italics in a single font file
  • Can read normal Z/X/Y tile URLs or offline, static-hosted tile archives in PMTiles format
  • Full out-of-the-box support for right-to-left and Indic/Brahmic writing systems
  • Configurable via plain JavaScript
  • (Advanced) Extensible API for defining your own symbolizers

See the docs on what protomaps-leaflet is, what protomaps-leaflet is not

Demos

How to use

<script src="https://unpkg.com/protomaps-leaflet@latest/dist/protomaps-leaflet.min.js"></script>
<script>
    const map = L.map('map')
    var layer = protomapsL.leafletLayer({url:'FILE.pmtiles OR ENDPOINT/{z}/{x}/{y}.mvt',theme:"light"})
    layer.addTo(map)
</script>

See Also

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.