No description, website, or topics provided.
Pull request Compare This branch is 7146 commits behind openstreetmap:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
css
docs
icons
js
presets
test
.gitignore
LICENSE
Makefile
NOTES.md
README.md
index.html
screenshot.jpg

README.md

iD - friendly JavaScript editor for OpenStreetMap

Try the online demo of the most recent code.

Basics

  • iD is a JavaScript-based OpenStreetMap editor.
  • It's intentionally simple. This is not a 90% editor - not even a 70% editor. It should let you do the most basic tasks while not breaking other people's data. Nothing more. (Same goes for the code, so go easy on the abstraction. :) )
  • We're aiming to support modern desktop browsers and mobile browsers. The map rendering uses SVG via d3.

Architecture

  • iD uses d3 for graphics & managing databindings to the map. There's a tiny tiled-map core, but the majority of the action is in dynamic rendering of the editable map data.
  • This project aims to create a usable object model of OpenStreetMap data in Javascript that can be transformed by actions and serialized back into changesets

Getting started

To run the code locally, just fork this project and run it from a local webserver. With a Mac, you can enable Web Sharing and drop this in your website directory.

If you have Python handy, just cd into iD and run

 python -m SimpleHTTPServer

How it works

The code inherits many elements from the Potlatch 2 and JOSM editors.

We store technical notes in NOTES.md. The basic architecture is as follows:

  • Map: vector rendering, panning behaviors & zoom/center state
  • Tiles: receives map centers & draw tiles as a background for iD
  • Connection: requests /map data from osm, parses this data and delivers it to the Graph
  • Graph: stores a javascript object of id -> osm object
  • History: stores multiple graphs which represent undo states

Relationships:

  • Map has-a Tiles
  • Map has-a Connection
  • Map has-a History
  • History has-many Graphs

Coding tips

This project has a few basic guidelines for incoming code. The cardinal rules are:

  1. Soft tabs only
  2. Everything should pass jshint without warning
  3. Never write bugs

(you can write bugs). If you need a style guide, AirBNB has a decent one.

Come on in, the water's lovely. More help? Ping RichardF or tmcw on IRC (irc.oftc.net, in #osm-dev or #osm), on the OSM mailing lists or at richard@systemeD.net.

License

iD is available under the WTFPL, though obviously, if you want to dual-license any contributions that's cool. It includes d3js, which BSD-licensed.