Giter VIP home page Giter VIP logo

changeset-map's Introduction

OSM Changeset Viewer on a GL Map

Contributor Covenant

Changeset viewer module for osmcha.org (Example, Github).

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, Github).

Use as a module

Create a container div to hold the UI.

<div id='container'></div>
// 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
  • asdf install # To install the required tools from .tool-versions
  • yarn add react react-dom # Install those packages manually
  • yarn install # Install packages
  • yarn start # To get going โ€ฆ

changeset-map's People

Contributors

ajithranka avatar amishas157 avatar bhousel avatar dependabot[bot] avatar geohacker avatar iandees avatar kepta avatar mzagorskirs avatar nrotstan avatar rasagy avatar tordans avatar willemarcel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

changeset-map's Issues

Separate out OSM tags and metadata tags in tag diff view

Some of the properties in the tag diff view are actual tags for the feature in OpenStreetMap and some are metadata tags - like changeset, timestamp, etc.

These should possibly be visually separated in some way.

List of metadata tags: timestamp, version, changeset, user, uid, changeType

cc @planemad @ajithranka

I'm not sure what this visual separation should look like, and this is possibly not urgent, but filing so that we track this.

Improve map styling

Current style:

untitled3

  • Cannot readily distinguish between colors
  • Not color blind friendly

Show an error if no elements returned from overpass

This is generally due to a problem with Overpass - we should just alert the user or so if there were no elements returned from Overpass and mention that it maybe a problem with the Overpass instance that is being used.

Would caching these changeset diffs help?

I've been poking around with caching OSM data like crazy and these changeset diffs are a prime example of something that it seems would be perfect caching candidates.

Am I correct in thinking that the changeset diff from Overpass does not change once the changeset has been closed? Do you make frequent requests for the same changeset?

I would propose that I set up an S3 bucket that this webapp can hit. If the changeset isn't in the S3 bucket, it forwards to a lambda function (via API gateway) that makes the same request that you do now, but also saves it to S3 so that future requests can return the static file immediately.

Change the cursor type on hover

When hovering over a feature, change the cursor type from default to a pointer.

One possible way is to use map.getCanvas().style.cursor.

Use the latest version of Mapbox GL JS (v0.17.0)

Currently at v0.14.2 but can move to v0.17.0. This is a breaking change and will require changing some of the render code. Particularly, map.featureAt has to be replaced with map.queryRenderedFeatures.

Open data in OSM editors (JOSM, iD)

Several options, I want when inspecting a changeset:

  • Select a specific object way/node and open in (JOSM, iD).
  • Zoom to a specific area and load data in (JOSM, iD) within that bbox.

Permalink for features

When you click on a feature, it should add that feature id to the URL in some way.

Coming back to the URL should take you to the changeset with that particular feature selected.

cc @ajithranka

View info of deleted features

This is a changeset with many bad geometries. Clicking on the deleted geometries (red) should atleast display the object id and the old properties if possible.

Show change to a feature

This is changeset map, but many times a data reviewer may be interested in the change to a certain feature. A use case is a automatic report that detects an object X was moved by a km.

How can someone use changeset-map to easily inspect the change just to feature X?

cc @batpad @ajithranka

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.