{"id":18549346,"url":"https://github.com/adamfranco/openmapsamples","last_synced_at":"2025-04-09T21:32:36.420Z","repository":{"id":66506182,"uuid":"450272796","full_name":"adamfranco/OpenMapSamples","owner":"adamfranco","description":"A library to generate and provide sample data for testing vector-based map renderings.","archived":false,"fork":false,"pushed_at":"2022-05-17T19:48:12.000Z","size":59,"stargazers_count":7,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-24T11:56:53.721Z","etag":null,"topics":["maplibre","openstreetmap","osm","vector-tiles"],"latest_commit_sha":null,"homepage":"https://adamfranco.github.io/OpenMapSamples-examples/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adamfranco.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-20T22:07:17.000Z","updated_at":"2023-04-08T10:22:03.000Z","dependencies_parsed_at":"2023-02-22T13:30:23.120Z","dependency_job_id":null,"html_url":"https://github.com/adamfranco/OpenMapSamples","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamfranco%2FOpenMapSamples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamfranco%2FOpenMapSamples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamfranco%2FOpenMapSamples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamfranco%2FOpenMapSamples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adamfranco","download_url":"https://codeload.github.com/adamfranco/OpenMapSamples/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248114873,"owners_count":21050134,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["maplibre","openstreetmap","osm","vector-tiles"],"created_at":"2024-11-06T20:38:44.445Z","updated_at":"2025-04-09T21:32:36.409Z","avatar_url":"https://github.com/adamfranco.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenMapSamples\n\nOpenMapSamples 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.\n\nYou can view a demonstration of this control at https://adamfranco.github.io/OpenMapSamples-examples/.\n\n## Structure\n\n### Library classes\nOpenMapSamples allows the creation, registration, and return of a collection of `Sample`s for rendering. Each `Sample` has a name and description plus a list of 0 or more `Layer`s.\n\nEach `Sample` has methods to return a starting zoom level, center coordinate, and can access the GeoJSON data of its layers.\n\nEach `Layer` can have 0 or more `SampleData` added to it. The only requirement of `SampleData` classes that they implement a `getGeoJson(z)` method.\n\n * A `SimpleSample` returns hand-coded GeoJSON.\n * A `WayRowsSample` takes a list of tags for each row, and a list of tags for each column and applies those to dynamically generate GeoJSON for each zoom/center requested.  (For example, showing different highway types with bridge, tunnel, embankment, etc tags applied at each level). Lengths and spacing are dynamically chosen based on the zoom requested.\n * A `WayIntersectionSample` takes a list of tags for each row/column, then builds a cross-hatched grid that show each type of way intersecting with each other type.\n * A `WayOverlapSample` is the same as the `WayIntersectionSample`, but with ways overlapping rather than intersecting on shared nodes (For example, showing tunnel and bridge levels overlapping).\n * Other samples could auto generate overlapping or non-overlapping grids of areas, nodes, etc.\n\n### Samples\nThe `samples/` directory contains a repository of samples with full data that can be used directly to test map renderings. While users are welcome to utilize the library classes to develop their own data-sets, consider contributing useful samples to back to this project.\n\n#### OpenMapTiles\nThe `samples/OpenMapTiles/` directory contains samples with properties matching the [OpenMapTiles vector-data schema](https://openmaptiles.org/schema/).\n\nExample screenshots of the OpenMapTiles samples as rendered by the MapTiler \"OSM Standard\" style:\n\n![Highway Attributes](https://user-images.githubusercontent.com/25242/153935470-9e2fb1a6-7577-4b3b-8720-55281bc9b87f.png)\n\n![Highway Intersections](https://user-images.githubusercontent.com/25242/153935474-387884dc-100e-43c7-9b74-b731a0e282ee.png)\n\n![Highway Bridge \u0026 Tunnel](https://user-images.githubusercontent.com/25242/153935476-453918ed-41a9-47d7-8190-aa4ebfc4dbd7.png)\n\n## Controls and integrations\n\nThe OpenMapSamples classes and Samples are renderer agnostic and may be used by any map display system.\n\n### MapLibre\nSee [adamfranco/OpenMapSamples-MapLibre](https://github.com/adamfranco/OpenMapSamples-MapLibre) for a MapLibre control that can be added to MapLibre based maps. This control provides a dialog selecting samples and temporarily replacing map content with sample data.\n\n### OpenLayers\n_To do..._\n\n## Development\n\nTo add an additional sample data set in the OpenMapTiles schema:\n\n1. Add a new script under `samples/OpenMapTiles/`. This script should export a `Sample` as default.\n2. Add the new Sample to `samples/OpenMapTiles/index.js` to register it for use.\n3. Run `npm run test` to ensure that your new sample is returning valid GeoJSON.\n\nTo test your sample in a browser, clone the [OpenMapTilesSamples-examples](https://github.com/adamfranco/OpenMapSamples-examples) repository in the same parent-directory as `OpenMapSamples/` and configure it:\n\n    cd ../\n    git clone git@github.com:adamfranco/OpenMapSamples-examples.git\n    cd OpenMapSamples-examples/\n    npm install\n    npm run config\n    # Edit config.js and add your MapTiler cloud key.\n    npm run dev-openmapsamples\n    npm start\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamfranco%2Fopenmapsamples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadamfranco%2Fopenmapsamples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamfranco%2Fopenmapsamples/lists"}