Coder Social home page Coder Social logo

adamfranco / openmapsamples-maplibre Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 2.0 1.5 MB

A control and integration to display OpenMapSamples vector data in MapLibre-based maps.

Home Page: https://adamfranco.github.io/OpenMapSamples-examples/

License: GNU Lesser General Public License v3.0

JavaScript 95.20% CSS 4.80%
maplibre maplibre-gl-js maplibregl osm openstreetmap vector-map

openmapsamples-maplibre's Introduction

OpenMapSamples-MapLibre

OpenMapSamples is a library to generate and provide sample data for testing vector-based map renderings. Sample data is returned as GeoJSON and can be rendered by mapping systems and styles to validate their coverage of combinations of data at different zooms without hand-mapping all possible combinations.

The OpenMapSamples-MapLibre package provides a MapLibre control that allows OpenMapSamples to be swapped for real data in MapLibre-based maps.

You can view a demonstration of this control at https://adamfranco.github.io/OpenMapSamples-examples/. Look for the control in the bottom left of the map and choose a sample to replace the normal map data with sample data and jump to the sample-data locations.

Screen-shot of a Highway sample

Usage

The SampleControl for MapLibre provides a button and dialog that temporarily replaces the source data in the map's style with sample data.

import SampleControl from 'openmapsamples-maplibre/OpenMapSamplesControl';
import { default as OpenMapTilesSamples } from "openmapsamples/samples/OpenMapTiles";

// Add our sample data.
let sampleControl = new SampleControl({'permalinks': true});

OpenMapTilesSamples.forEach((sample, i) => {
  sampleControl.addSample(sample);
});

// Map is a previously configure maplibre-gl map.
map.addControl(sampleControl, 'bottom-left');

openmapsamples-maplibre's People

Contributors

adamfranco avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

openmapsamples-maplibre's Issues

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.