https://github.com/osmlab/changeset-map
Visualise a changeset on a map
https://github.com/osmlab/changeset-map
Last synced: over 1 year ago
JSON representation
Visualise a changeset on a map
- Host: GitHub
- URL: https://github.com/osmlab/changeset-map
- Owner: osmlab
- License: isc
- Created: 2016-03-15T12:36:40.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2024-09-12T20:00:49.000Z (almost 2 years ago)
- Last Synced: 2024-10-30T15:58:40.269Z (over 1 year ago)
- Language: JavaScript
- Homepage: http://osmlab.github.io/changeset-map/
- Size: 31.9 MB
- Stars: 34
- Watchers: 25
- Forks: 12
- Open Issues: 55
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
### OSM Changeset Viewer on a GL Map
[](code_of_conduct.md)

Changeset viewer module for [osmcha.org](https://osmcha.org/) ([Example](https://osmlab.github.io/changeset-map/#110574164), [Github](https://github.com/mapbox/osmcha-frontend)).
Pass a changeset id to render details of changes made by that changeset on a MapboxGL map.
Heavily inspired by the ACHAVI Changeset Viewer ([Example](https://overpass-api.de/achavi/?changeset=110574164), [Github](https://github.com/nrenner/achavi)).
### Use as a module
Create a container div to hold the UI.
```html
```
```js
// es6 modules
import {getChangeset, query, propsDiff, render} from 'changeset-map';
// commonjs
var changesetMap = require('changeset-map');
var render = changesetMap.render;
var container = document.getElementById('container');
var changesetMapControl = render(container, changesetID, { width: '1000px', height: '1000px' });
// binding events
changesetMapControl.on('load', function () {
changesetMapControl.emit('selectFeature', 'node|way', featureId);
changesetMapControl.emit('clearFeature');
changesetMapControl.on('hashchange', function(geometryType, featureId) {
// update hash.
});
})
```
For a custom overpass instance, set a `overpassBase` key in the options object. Default instance is https://overpass.osmcha.org/api/interpreter.
### Build
- Build the plugin by `npm run build`.
- Build the website by `npm run build:website`, the websites html can be found in `public` folder. The javascript code to run changeset map can be found in `www` folder.
### Development
- Install [asdf version manager](https://asdf-vm.com/guide/getting-started.html#getting-started)
- `asdf install` # To install the required tools from [.tool-versions](./.tool-versions)
- `yarn add react react-dom` # Install those packages manually
- `yarn install` # Install packages
- `yarn start` # To get going …