Translatable documentation, Fixes #1108

* Adds Marked
* Fixes a global leak in toGeoJSON
* Removes marked from package.json
* Adds documentation to core.yaml
* Removes stray console.log from tests
This commit is contained in:
Tom MacWright
2013-03-27 14:32:29 -04:00
parent 18aa33ba97
commit b59f28424c
21 changed files with 1444 additions and 321 deletions

View File

@@ -30,6 +30,8 @@ data/data.js: $(DATA_FILES)
js/lib/ohauth.js \
js/lib/rtree.js \
js/lib/sha.js \
js/lib/togeojson.js \
js/lib/marked.js \
js/id/start.js \
js/id/id.js \
js/id/connection.js \

View File

@@ -2,7 +2,6 @@ var fs = require('fs'),
path = require('path'),
glob = require('glob'),
YAML = require('js-yaml'),
marked = require('marked'),
_ = require('./js/lib/lodash'),
jsonschema = require('jsonschema'),
fieldSchema = require('./data/presets/schema/field.json'),
@@ -48,20 +47,6 @@ var translations = {
presets: {}
};
function generateDocumentation() {
var docs = [];
glob.sync(__dirname + '/data/doc/*.md').forEach(function(file) {
var text = readtxt(file),
title = text.split('\n')[0]
.replace('#', '').trim();
docs.push({
html: marked(text.split('\n').slice(1).join('\n')),
title: title
});
});
fs.writeFileSync('data/doc.json', stringify(docs));
}
function generateFields() {
var fields = {};
glob.sync(__dirname + '/data/presets/fields/*.json').forEach(function(file) {
@@ -101,7 +86,6 @@ function generatePresets() {
fs.writeFileSync('data/presets.yaml', YAML.dump({en: {presets: translations}}));
}
generateDocumentation();
generateFields();
generatePresets();
@@ -110,7 +94,6 @@ fs.writeFileSync('data/data.js', 'iD.data = ' + stringify({
discarded: r('discarded.json'),
keys: r('keys.json'),
imagery: r('imagery.json'),
doc: r('doc.json'),
presets: {
presets: rp('presets.json'),
defaults: rp('defaults.json'),

View File

@@ -13,6 +13,7 @@ en:
description: "Add restaurants, monuments, postal boxes or other points to the map."
tail: Click on the map to add a point.
browse:
title: Browse
description: Pan and zoom the map.
draw_area:
@@ -189,3 +190,239 @@ en:
drag_drop: "Drag and drop a .gpx file on the page"
help:
title: "Help"
help: |
# Help
This is an editor for [OpenStreetMap](http://www.openstreetmap.org/), the
free and editable map of the world. You can use it to add and update
data in your area, making an open-source and open-data map of the world
better for everyone.
Edits that you make on this map will be visible to everyone who uses
OpenStreetMap. In order to make an edit, you'll need a
[free OpenStreetMap account](https://www.openstreetmap.org/user/new).
The [iD editor](http://ideditor.com/) is a collaborative project with [source
code available on GitHub](https://github.com/systemed/iD).
editing_saving: |
# Editing & Saving
This editor is designed to work primarily online, and you're accessing
it through a website right now.
### Selecting Features
To select a map feature, like a road or point of interest, click
on it on the map. This will highlight the selected feature, open a panel with
details about it, and show a menu of things you can do with the feature.
Multiple features can be selected by holding the 'Shift' key, clicking,
and dragging on the map. This will select all features within the box
that's drawn, allowing you to do things with several features at once.
### Saving Edits
When you make changes like editing roads, buildings, and places, these are
stored locally until you save them to the server. Don't worry if you make
a mistake - you can undo changes by clicking the undo button, and redo
changes by clicking the redo button.
Click 'Save' to finish a group of edits - for instance, if you've completed
an area of town and would like to start on a new area. You'll have a chance
to review what you've done, and the editor supplies helpful suggestions
and warnings if something doesn't seem right about the changes.
If everything looks good, you can enter a short comment explaining the change
you made, and click 'Save' again to post the changes
to [OpenStreetMap.org](http://www.openstreetmap.org/), where they are visible
to all other users and available for others to build and improve upon.
If you can't finish your edits in one sitting, you can leave the editor
window and come back (on the same browser and computer), and the
editor application will offer to restore your work.
roads: |
# Roads
You can create, fix, and delete roads with this editor. Roads can be all
kinds: paths, highways, trails, cycleways, and more - any often-crossed
segment should be mappable.
### Selecting
Click on a road to select it. An outline should become visible, along
with a small tools menu on the map and a sidebar showing more information
about the road.
### Modifying
Often you'll see roads that aren't aligned to the imagery behind them
or to a GPS track. You can adjust these roads so they are in the correct
place.
First click on the road you want to change. This will highlight it and show
control points along it that you can drag to better locations. If
you want to add new control points for more detail, double-click a part
of the road without a point, and one will be added.
If the road connects to another road, but doesn't properly connect on
the map, you can drag one of its control points onto the other road in
order to join them. Having roads connect is important for the map
and essential for providing driving directions.
You can also click the 'Move' tool or press the `M` shortcut key to move the entire road at
one time, and then click again to save that movement.
### Deleting
If a road is entirely incorrect - you can see that it doesn't exist in satellite
imagery and ideally have confirmed locally that it's not present - you can delete
it, which removes it from the map. Be cautious when deleting features -
like any other edit, the results are seen by everyone and satellite imagery
is often out of date, so the road could simply be newly built.
You can delete a road by clicking on it to select it, then clicking the
trash can icon or pressing the 'Delete' key.
### Creating
Found somewhere there should be a road but there isn't? Click the 'Line'
icon in the top-left of the editor or press the shortcut key `2` to start drawing
a line.
Click on the start of the road on the map to start drawing. If the road
branches off from an existing road, start by clicking on the place where they connect.
Then click on points along the road so that it follows the right path, according
to satellite imagery or GPS. If the road you are drawing crosses another road, connect
it by clicking on the intersection point. When you're done drawing, double-click
or press 'Return' or 'Enter' on your keyboard.
gps: |
# GPS
GPS data is the most trusted source of data for OpenStreetMap. This editor
supports local traces - `.gpx` files on your local computer. You can collect
this kind of GPS trace with a number of smartphone applications as well as
personal GPS hardware.
For information on how to perform a GPS survey, read
[Surveying with a GPS](http://learnosm.org/en/beginner/using-gps/).
To use a GPX track for mapping, drag and drop the GPX file onto the map
editor. If it's recognized, it will be added to the map as a bright green
line. Click on the 'Background Settings' menu on the left side to enable,
disable, or zoom to this new GPX-powered layer.
The GPX track isn't directly uploaded to OpenStreetMap - the best way to
use it is to draw on the map, using it as a guide for the new features that
you add.
imagery: |
# Imagery
Aerial imagery is an important resource for mapping. A combination of
airplane flyovers, satellite views, and freely-compiled sources are available
in the editor under the 'Background Settings' menu on the left.
By default a [Bing Maps](http://www.bing.com/maps/) satellite layer is
presented in the editor, but as you pan and zoom the map to new geographical
areas, new sources will become available. Some countries, like the United
States, France, and Denmark have very high-quality imagery available for some areas.
Imagery is sometimes offset from the map data because of a mistake on the
imagery provider's side. If you see a lot of roads shifted from the background,
don't immediately move them all to match the background. Instead you can adjust
the imagery so that it matches the existing data by clicking 'Fix alignment' at
the bottom of the Background Settings UI.
addresses: |
# Addresses
Addresses are some of the most useful information for the map.
Although addresses are often represented as parts of streets, in OpenStreetMap
they're recorded as attributes of buildings and places along streets.
You can add address information to places mapped as building outlines as well
as well as those mapped as single points. The optimal source of address
data is from an on-the-ground survey or personal knowledge - as with any
other feature, copying from commercial sources like Google Maps is strictly
forbidden.
inspector: |
# Using the Inspector
The inspector is the user interface element on the right-hand side of the
page that appears when a feature is selected and allows you to edit its details.
### Selecting a Feature Type
After you add a point, line, or area, you can choose what type of feature it
is, like whether it's a highway or residential road, supermarket or cafe.
The inspector will display buttons for common feature types, and you can
find others by typing what you're looking for in the search box.
Click the 'i' in the bottom-right-hand corner of a feature type button to
learn more about it. Click a button to choose that type.
### Using Forms and Editing Tags
After you choose a feature type, or when you select a feature that already
has a type assigned, the inspector will display fields with details about
the feature like its name and address.
Below the fields you see, you can click icons to add other details,
like [Wikipedia](http://www.wikipedia.org/) information, wheelchair
access, and more.
At the bottom of the inspector, click 'Additional tags' to add arbitrary
other tags to the element. [Taginfo](http://taginfo.openstreetmap.org/) is a
great resource for learn more about popular tag combinations.
Changes you make in the inspector are automatically applied to the map.
You can undo them at any time by clicking the 'Undo' button.
### Closing the Inspector
You can close the inspector by clicking the close button in the top-right,
pressing the 'Escape' key, or clicking on the map.
buildings: |
# Buildings
OpenStreetMap is the world's largest database of buildings. You can create
and improve this database.
### Selecting
You can select a building by clicking on its border. This will highlight the
building and open a small tools menu and a sidebar showing more information
about the building.
### Modifying
Sometimes buildings are incorrectly placed or have incorrect tags.
To move an entire building, select it, then click the 'Move' tool. Move your
mouse to shift the building, and click when it's correctly placed.
To fix the specific shape of a building, click and drag the points that form
its border into better places.
### Creating
One of the main questions around adding buildings to the map is that
OpenStreetMap records buildings both as shapes and points. The rule of thumb
is to _map a building as a shape whenever possible_, and map companies, homes,
amenities, and other things that operate out of buildings as points placed
within the building shape.
Start drawing a building as a shape by clicking the 'Area' button in the top
left of the interface, and end it either by pressing 'Return' on your keyboard
or clicking on the first point drawn to close the shape.
### Deleting
If a building is entirely incorrect - you can see that it doesn't exist in satellite
imagery and ideally have confirmed locally that it's not present - you can delete
it, which removes it from the map. Be cautious when deleting features -
like any other edit, the results are seen by everyone and satellite imagery
is often out of date, so the road could simply be newly built.
You can delete a building by clicking on it to select it, then clicking the
trash can icon or pressing the 'Delete' key.

View File

@@ -12,8 +12,8 @@ iD.data = {
path + 'data/presets/presets.json',
path + 'data/presets/defaults.json',
path + 'data/presets/categories.json',
path + 'data/presets/fields.json',
path + 'data/doc.json'], d3.json, function (err, data) {
path + 'data/presets/fields.json'
], d3.json, function (err, data) {
iD.data = {
deprecated: data[0],
@@ -25,8 +25,7 @@ iD.data = {
defaults: data[5],
categories: data[6],
fields: data[7]
},
doc: data[8]
}
};
callback();

View File

@@ -1,34 +0,0 @@
[
{
"html": "<p>This is an editor for <a href=\"http://www.openstreetmap.org/\">OpenStreetMap</a>, the\nfree and editable map of the world. You can use it to add and update\ndata in your area, making an open-source and open-data map of the world\nbetter for everyone.</p>\n<p>Edits that you make on this map will be visible to everyone who uses\nOpenStreetMap. In order to make an edit, you&#39;ll need a\n<a href=\"https://www.openstreetmap.org/user/new\">free OpenStreetMap account</a>.</p>\n<p>The <a href=\"http://ideditor.com/\">iD editor</a> is a collaborative project with <a href=\"https://github.com/systemed/iD\">source\ncode available on GitHub</a>.</p>\n",
"title": "Help"
},
{
"html": "<p>This editor is designed to work primarily online, and you&#39;re accessing\nit through a website right now.</p>\n<h3>Selecting Features</h3>\n<p>To select a map feature, like a road or point of interest, click\non it on the map. This will highlight the selected feature, open a panel with\ndetails about it, and show a menu of things you can do with the feature.</p>\n<p>Multiple features can be selected by holding the &#39;Shift&#39; key, clicking,\nand dragging on the map. This will select all features within the box\nthat&#39;s drawn, allowing you to do things with several features at once.</p>\n<h3>Saving Edits</h3>\n<p>When you make changes like editing roads, buildings, and places, these are\nstored locally until you save them to the server. Don&#39;t worry if you make\na mistake - you can undo changes by clicking the undo button, and redo\nchanges by clicking the redo button.</p>\n<p>Click &#39;Save&#39; to finish a group of edits - for instance, if you&#39;ve completed\nan area of town and would like to start on a new area. You&#39;ll have a chance\nto review what you&#39;ve done, and the editor supplies helpful suggestions\nand warnings if something doesn&#39;t seem right about the changes.</p>\n<p>If everything looks good, you can enter a short comment explaining the change\nyou made, and click &#39;Save&#39; again to post the changes\nto <a href=\"http://www.openstreetmap.org/\">OpenStreetMap.org</a>, where they are visible\nto all other users and available for others to build and improve upon.</p>\n<p>If you can&#39;t finish your edits in one sitting, you can leave the editor\nwindow and come back (on the same browser and computer), and the\neditor application will offer to restore your work.</p>\n",
"title": "Editing & Saving"
},
{
"html": "<p>You can create, fix, and delete roads with this editor. Roads can be all\nkinds: paths, highways, trails, cycleways, and more - any often-crossed\nsegment should be mappable.</p>\n<h3>Selecting</h3>\n<p>Click on a road to select it. An outline should become visible, along\nwith a small tools menu on the map and a sidebar showing more information\nabout the road.</p>\n<h3>Modifying</h3>\n<p>Often you&#39;ll see roads that aren&#39;t aligned to the imagery behind them\nor to a GPS track. You can adjust these roads so they are in the correct\nplace.</p>\n<p>First click on the road you want to change. This will highlight it and show\ncontrol points along it that you can drag to better locations. If\nyou want to add new control points for more detail, double-click a part\nof the road without a point, and one will be added.</p>\n<p>If the road connects to another road, but doesn&#39;t properly connect on\nthe map, you can drag one of its control points onto the other road in\norder to join them. Having roads connect is important for the map\nand essential for providing driving directions.</p>\n<p>You can also click the &#39;Move&#39; tool or press the <code>M</code> shortcut key to move the entire road at\none time, and then click again to save that movement.</p>\n<h3>Deleting</h3>\n<p>If a road is entirely incorrect - you can see that it doesn&#39;t exist in satellite\nimagery and ideally have confirmed locally that it&#39;s not present - you can delete\nit, which removes it from the map. Be cautious when deleting features -\nlike any other edit, the results are seen by everyone and satellite imagery\nis often out of date, so the road could simply be newly built.</p>\n<p>You can delete a road by clicking on it to select it, then clicking the\ntrash can icon or pressing the &#39;Delete&#39; key.</p>\n<h3>Creating</h3>\n<p>Found somewhere there should be a road but there isn&#39;t? Click the &#39;Line&#39;\nicon in the top-left of the editor or press the shortcut key <code>2</code> to start drawing\na line.</p>\n<p>Click on the start of the road on the map to start drawing. If the road\nbranches off from an existing road, start by clicking on the place where they connect.</p>\n<p>Then click on points along the road so that it follows the right path, according\nto satellite imagery or GPS. If the road you are drawing crosses another road, connect\nit by clicking on the intersection point. When you&#39;re done drawing, double-click\nor press &#39;Return&#39; or &#39;Enter&#39; on your keyboard.</p>\n",
"title": "Roads"
},
{
"html": "<p>GPS data is the most trusted source of data for OpenStreetMap. This editor\nsupports local traces - <code>.gpx</code> files on your local computer. You can collect\nthis kind of GPS trace with a number of smartphone applications as well as\npersonal GPS hardware.</p>\n<p>For information on how to perform a GPS survey, read\n<a href=\"http://learnosm.org/en/beginner/using-gps/\">Surveying with a GPS</a>.</p>\n<p>To use a GPX track for mapping, drag and drop the GPX file onto the map\neditor. If it&#39;s recognized, it will be added to the map as a bright green\nline. Click on the &#39;Background Settings&#39; menu on the left side to enable,\ndisable, or zoom to this new GPX-powered layer.</p>\n<p>The GPX track isn&#39;t directly uploaded to OpenStreetMap - the best way to\nuse it is to draw on the map, using it as a guide for the new features that\nyou add.</p>\n",
"title": "GPS"
},
{
"html": "<p>Aerial imagery is an important resource for mapping. A combination of\nairplane flyovers, satellite views, and freely-compiled sources are available\nin the editor under the &#39;Background Settings&#39; menu on the left.</p>\n<p>By default a <a href=\"http://www.bing.com/maps/\">Bing Maps</a> satellite layer is\npresented in the editor, but as you pan and zoom the map to new geographical\nareas, new sources will become available. Some countries, like the United\nStates, France, and Denmark have very high-quality imagery available for some areas.</p>\n<p>Imagery is sometimes offset from the map data because of a mistake on the\nimagery provider&#39;s side. If you see a lot of roads shifted from the background,\ndon&#39;t immediately move them all to match the background. Instead you can adjust\nthe imagery so that it matches the existing data by clicking &#39;Fix alignment&#39; at\nthe bottom of the Background Settings UI.</p>\n",
"title": "Imagery"
},
{
"html": "<p>Addresses are some of the most useful information for the map.</p>\n<p>Although addresses are often represented as parts of streets, in OpenStreetMap\nthey&#39;re recorded as attributes of buildings and places along streets.</p>\n<p>You can add address information to places mapped as building outlines as well\nas well as those mapped as single points. The optimal source of address\ndata is from an on-the-ground survey or personal knowledge - as with any\nother feature, copying from commercial sources like Google Maps is strictly\nforbidden.</p>\n",
"title": "Addresses"
},
{
"html": "<p>The inspector is the user interface element on the right-hand side of the\npage that appears when a feature is selected and allows you to edit its details.</p>\n<h3>Selecting a Feature Type</h3>\n<p>After you add a point, line, or area, you can choose what type of feature it\nis, like whether it&#39;s a highway or residential road, supermarket or cafe.\nThe inspector will display buttons for common feature types, and you can\nfind others by typing what you&#39;re looking for in the search box.</p>\n<p>Click the &#39;i&#39; in the bottom-right-hand corner of a feature type button to\nlearn more about it. Click a button to choose that type.</p>\n<h3>Using Forms and Editing Tags</h3>\n<p>After you choose a feature type, or when you select a feature that already\nhas a type assigned, the inspector will display fields with details about\nthe feature like its name and address.</p>\n<p>Below the fields you see, you can click icons to add other details,\nlike <a href=\"http://www.wikipedia.org/\">Wikipedia</a> information, wheelchair\naccess, and more.</p>\n<p>At the bottom of the inspector, click &#39;Additional tags&#39; to add arbitrary\nother tags to the element. <a href=\"http://taginfo.openstreetmap.org/\">Taginfo</a> is a\ngreat resource for learn more about popular tag combinations.</p>\n<p>Changes you make in the inspector are automatically applied to the map.\nYou can undo them at any time by clicking the &#39;Undo&#39; button.</p>\n<h3>Closing the Inspector</h3>\n<p>You can close the inspector by clicking the close button in the top-right,\npressing the &#39;Escape&#39; key, or clicking on the map.</p>\n",
"title": "Using the Inspector"
},
{
"html": "<p>OpenStreetMap is the world&#39;s largest database of buildings. You can create\nand improve this database.</p>\n<h3>Selecting</h3>\n<p>You can select a building by clicking on its border. This will highlight the\nbuilding and open a small tools menu and a sidebar showing more information\nabout the building.</p>\n<h3>Modifying</h3>\n<p>Sometimes buildings are incorrectly placed or have incorrect tags.</p>\n<p>To move an entire building, select it, then click the &#39;Move&#39; tool. Move your\nmouse to shift the building, and click when it&#39;s correctly placed.</p>\n<p>To fix the specific shape of a building, click and drag the points that form\nits border into better places.</p>\n<h3>Creating</h3>\n<p>One of the main questions around adding buildings to the map is that\nOpenStreetMap records buildings both as shapes and points. The rule of thumb\nis to <em>map a building as a shape whenever possible</em>, and map companies, homes,\namenities, and other things that operate out of buildings as points placed\nwithin the building shape.</p>\n<p>Start drawing a building as a shape by clicking the &#39;Area&#39; button in the top\nleft of the interface, and end it either by pressing &#39;Return&#39; on your keyboard\nor clicking on the first point drawn to close the shape.</p>\n<h3>Deleting</h3>\n<p>If a building is entirely incorrect - you can see that it doesn&#39;t exist in satellite\nimagery and ideally have confirmed locally that it&#39;s not present - you can delete\nit, which removes it from the map. Be cautious when deleting features -\nlike any other edit, the results are seen by everyone and satellite imagery\nis often out of date, so the road could simply be newly built.</p>\n<p>You can delete a building by clicking on it to select it, then clicking the\ntrash can icon or pressing the &#39;Delete&#39; key.</p>\n",
"title": "Buildings"
}
]

View File

@@ -1,13 +0,0 @@
# Help
This is an editor for [OpenStreetMap](http://www.openstreetmap.org/), the
free and editable map of the world. You can use it to add and update
data in your area, making an open-source and open-data map of the world
better for everyone.
Edits that you make on this map will be visible to everyone who uses
OpenStreetMap. In order to make an edit, you'll need a
[free OpenStreetMap account](https://www.openstreetmap.org/user/new).
The [iD editor](http://ideditor.com/) is a collaborative project with [source
code available on GitHub](https://github.com/systemed/iD).

View File

@@ -1,35 +0,0 @@
# Editing & Saving
This editor is designed to work primarily online, and you're accessing
it through a website right now.
### Selecting Features
To select a map feature, like a road or point of interest, click
on it on the map. This will highlight the selected feature, open a panel with
details about it, and show a menu of things you can do with the feature.
Multiple features can be selected by holding the 'Shift' key, clicking,
and dragging on the map. This will select all features within the box
that's drawn, allowing you to do things with several features at once.
### Saving Edits
When you make changes like editing roads, buildings, and places, these are
stored locally until you save them to the server. Don't worry if you make
a mistake - you can undo changes by clicking the undo button, and redo
changes by clicking the redo button.
Click 'Save' to finish a group of edits - for instance, if you've completed
an area of town and would like to start on a new area. You'll have a chance
to review what you've done, and the editor supplies helpful suggestions
and warnings if something doesn't seem right about the changes.
If everything looks good, you can enter a short comment explaining the change
you made, and click 'Save' again to post the changes
to [OpenStreetMap.org](http://www.openstreetmap.org/), where they are visible
to all other users and available for others to build and improve upon.
If you can't finish your edits in one sitting, you can leave the editor
window and come back (on the same browser and computer), and the
editor application will offer to restore your work.

View File

@@ -1,55 +0,0 @@
# Roads
You can create, fix, and delete roads with this editor. Roads can be all
kinds: paths, highways, trails, cycleways, and more - any often-crossed
segment should be mappable.
### Selecting
Click on a road to select it. An outline should become visible, along
with a small tools menu on the map and a sidebar showing more information
about the road.
### Modifying
Often you'll see roads that aren't aligned to the imagery behind them
or to a GPS track. You can adjust these roads so they are in the correct
place.
First click on the road you want to change. This will highlight it and show
control points along it that you can drag to better locations. If
you want to add new control points for more detail, double-click a part
of the road without a point, and one will be added.
If the road connects to another road, but doesn't properly connect on
the map, you can drag one of its control points onto the other road in
order to join them. Having roads connect is important for the map
and essential for providing driving directions.
You can also click the 'Move' tool or press the `M` shortcut key to move the entire road at
one time, and then click again to save that movement.
### Deleting
If a road is entirely incorrect - you can see that it doesn't exist in satellite
imagery and ideally have confirmed locally that it's not present - you can delete
it, which removes it from the map. Be cautious when deleting features -
like any other edit, the results are seen by everyone and satellite imagery
is often out of date, so the road could simply be newly built.
You can delete a road by clicking on it to select it, then clicking the
trash can icon or pressing the 'Delete' key.
### Creating
Found somewhere there should be a road but there isn't? Click the 'Line'
icon in the top-left of the editor or press the shortcut key `2` to start drawing
a line.
Click on the start of the road on the map to start drawing. If the road
branches off from an existing road, start by clicking on the place where they connect.
Then click on points along the road so that it follows the right path, according
to satellite imagery or GPS. If the road you are drawing crosses another road, connect
it by clicking on the intersection point. When you're done drawing, double-click
or press 'Return' or 'Enter' on your keyboard.

View File

@@ -1,18 +0,0 @@
# GPS
GPS data is the most trusted source of data for OpenStreetMap. This editor
supports local traces - `.gpx` files on your local computer. You can collect
this kind of GPS trace with a number of smartphone applications as well as
personal GPS hardware.
For information on how to perform a GPS survey, read
[Surveying with a GPS](http://learnosm.org/en/beginner/using-gps/).
To use a GPX track for mapping, drag and drop the GPX file onto the map
editor. If it's recognized, it will be added to the map as a bright green
line. Click on the 'Background Settings' menu on the left side to enable,
disable, or zoom to this new GPX-powered layer.
The GPX track isn't directly uploaded to OpenStreetMap - the best way to
use it is to draw on the map, using it as a guide for the new features that
you add.

View File

@@ -1,16 +0,0 @@
# Imagery
Aerial imagery is an important resource for mapping. A combination of
airplane flyovers, satellite views, and freely-compiled sources are available
in the editor under the 'Background Settings' menu on the left.
By default a [Bing Maps](http://www.bing.com/maps/) satellite layer is
presented in the editor, but as you pan and zoom the map to new geographical
areas, new sources will become available. Some countries, like the United
States, France, and Denmark have very high-quality imagery available for some areas.
Imagery is sometimes offset from the map data because of a mistake on the
imagery provider's side. If you see a lot of roads shifted from the background,
don't immediately move them all to match the background. Instead you can adjust
the imagery so that it matches the existing data by clicking 'Fix alignment' at
the bottom of the Background Settings UI.

View File

@@ -1,12 +0,0 @@
# Addresses
Addresses are some of the most useful information for the map.
Although addresses are often represented as parts of streets, in OpenStreetMap
they're recorded as attributes of buildings and places along streets.
You can add address information to places mapped as building outlines as well
as well as those mapped as single points. The optimal source of address
data is from an on-the-ground survey or personal knowledge - as with any
other feature, copying from commercial sources like Google Maps is strictly
forbidden.

View File

@@ -1,36 +0,0 @@
# Using the Inspector
The inspector is the user interface element on the right-hand side of the
page that appears when a feature is selected and allows you to edit its details.
### Selecting a Feature Type
After you add a point, line, or area, you can choose what type of feature it
is, like whether it's a highway or residential road, supermarket or cafe.
The inspector will display buttons for common feature types, and you can
find others by typing what you're looking for in the search box.
Click the 'i' in the bottom-right-hand corner of a feature type button to
learn more about it. Click a button to choose that type.
### Using Forms and Editing Tags
After you choose a feature type, or when you select a feature that already
has a type assigned, the inspector will display fields with details about
the feature like its name and address.
Below the fields you see, you can click icons to add other details,
like [Wikipedia](http://www.wikipedia.org/) information, wheelchair
access, and more.
At the bottom of the inspector, click 'Additional tags' to add arbitrary
other tags to the element. [Taginfo](http://taginfo.openstreetmap.org/) is a
great resource for learn more about popular tag combinations.
Changes you make in the inspector are automatically applied to the map.
You can undo them at any time by clicking the 'Undo' button.
### Closing the Inspector
You can close the inspector by clicking the close button in the top-right,
pressing the 'Escape' key, or clicking on the map.

View File

@@ -1,43 +0,0 @@
# Buildings
OpenStreetMap is the world's largest database of buildings. You can create
and improve this database.
### Selecting
You can select a building by clicking on its border. This will highlight the
building and open a small tools menu and a sidebar showing more information
about the building.
### Modifying
Sometimes buildings are incorrectly placed or have incorrect tags.
To move an entire building, select it, then click the 'Move' tool. Move your
mouse to shift the building, and click when it's correctly placed.
To fix the specific shape of a building, click and drag the points that form
its border into better places.
### Creating
One of the main questions around adding buildings to the map is that
OpenStreetMap records buildings both as shapes and points. The rule of thumb
is to _map a building as a shape whenever possible_, and map companies, homes,
amenities, and other things that operate out of buildings as points placed
within the building shape.
Start drawing a building as a shape by clicking the 'Area' button in the top
left of the interface, and end it either by pressing 'Return' on your keyboard
or clicking on the first point drawn to close the shape.
### Deleting
If a building is entirely incorrect - you can see that it doesn't exist in satellite
imagery and ideally have confirmed locally that it's not present - you can delete
it, which removes it from the map. Be cautious when deleting features -
like any other edit, the results are seen by everyone and satellite imagery
is often out of date, so the road could simply be newly built.
You can delete a building by clicking on it to select it, then clicking the
trash can icon or pressing the 'Delete' key.

View File

@@ -139,7 +139,7 @@ locale.en = {
"nothing_to_redo": "Nothing to redo.",
"just_edited": "You just edited OpenStreetMap!",
"browser_notice": "This editor is supported in Firefox, Chrome, Safari, Opera, and Internet Explorer 9 and above. Please upgrade your browser or use Potlatch 2 to edit the map.",
"view_on_osm": "View on OSM",
"view_on_osm": "View on OSM",
"zoom_in_edit": "zoom in to edit the map",
"logout": "logout",
"report_a_bug": "report a bug",
@@ -189,7 +189,7 @@ locale.en = {
},
"restore": {
"heading": "You have unsaved changes",
"description": "Do you wish to restore changes from a previous editing session?",
"description": "Do you wish to restore unsaved changes from a previous editing session?",
"restore": "Restore",
"reset": "Reset"
},
@@ -202,7 +202,7 @@ locale.en = {
"unsaved_changes": "You have unsaved changes"
},
"splash": {
"welcome": "Welcome to the iD OpenStreetMap Editor",
"welcome": "Welcome to the iD OpenStreetMap editor",
"text": "iD is a friendly but powerful tool for contributing to the world's best free world map. This is development version {version}. For more information see {website} and report bugs at {github}.",
"walkthrough": "Start the walkthrough",
"start": "Edit now"
@@ -234,7 +234,15 @@ locale.en = {
"drag_drop": "Drag and drop a .gpx file on the page"
},
"help": {
"title": "Help"
"title": "Help",
"help": "# Help\n\nThis is an editor for [OpenStreetMap](http://www.openstreetmap.org/), the\nfree and editable map of the world. You can use it to add and update\ndata in your area, making an open-source and open-data map of the world\nbetter for everyone.\n\nEdits that you make on this map will be visible to everyone who uses\nOpenStreetMap. In order to make an edit, you'll need a\n[free OpenStreetMap account](https://www.openstreetmap.org/user/new).\n\nThe [iD editor](http://ideditor.com/) is a collaborative project with [source\ncode available on GitHub](https://github.com/systemed/iD).\n",
"editing_saving": "# Editing & Saving\n\nThis editor is designed to work primarily online, and you're accessing\nit through a website right now.\n\n### Selecting Features\n\nTo select a map feature, like a road or point of interest, click\non it on the map. This will highlight the selected feature, open a panel with\ndetails about it, and show a menu of things you can do with the feature.\n\nMultiple features can be selected by holding the 'Shift' key, clicking,\nand dragging on the map. This will select all features within the box\nthat's drawn, allowing you to do things with several features at once.\n\n### Saving Edits\n\nWhen you make changes like editing roads, buildings, and places, these are\nstored locally until you save them to the server. Don't worry if you make\na mistake - you can undo changes by clicking the undo button, and redo\nchanges by clicking the redo button.\n\nClick 'Save' to finish a group of edits - for instance, if you've completed\nan area of town and would like to start on a new area. You'll have a chance\nto review what you've done, and the editor supplies helpful suggestions\nand warnings if something doesn't seem right about the changes.\n\nIf everything looks good, you can enter a short comment explaining the change\nyou made, and click 'Save' again to post the changes\nto [OpenStreetMap.org](http://www.openstreetmap.org/), where they are visible\nto all other users and available for others to build and improve upon.\n\nIf you can't finish your edits in one sitting, you can leave the editor\nwindow and come back (on the same browser and computer), and the\neditor application will offer to restore your work.\n",
"roads": "# Roads\n\nYou can create, fix, and delete roads with this editor. Roads can be all\nkinds: paths, highways, trails, cycleways, and more - any often-crossed\nsegment should be mappable.\n\n### Selecting\n\nClick on a road to select it. An outline should become visible, along\nwith a small tools menu on the map and a sidebar showing more information\nabout the road.\n\n### Modifying\n\nOften you'll see roads that aren't aligned to the imagery behind them\nor to a GPS track. You can adjust these roads so they are in the correct\nplace.\n\nFirst click on the road you want to change. This will highlight it and show\ncontrol points along it that you can drag to better locations. If\nyou want to add new control points for more detail, double-click a part\nof the road without a point, and one will be added.\n\nIf the road connects to another road, but doesn't properly connect on\nthe map, you can drag one of its control points onto the other road in\norder to join them. Having roads connect is important for the map\nand essential for providing driving directions.\n\nYou can also click the 'Move' tool or press the `M` shortcut key to move the entire road at\none time, and then click again to save that movement.\n\n### Deleting\n\nIf a road is entirely incorrect - you can see that it doesn't exist in satellite\nimagery and ideally have confirmed locally that it's not present - you can delete\nit, which removes it from the map. Be cautious when deleting features -\nlike any other edit, the results are seen by everyone and satellite imagery\nis often out of date, so the road could simply be newly built.\n\nYou can delete a road by clicking on it to select it, then clicking the\ntrash can icon or pressing the 'Delete' key.\n\n### Creating\n\nFound somewhere there should be a road but there isn't? Click the 'Line'\nicon in the top-left of the editor or press the shortcut key `2` to start drawing\na line.\n\nClick on the start of the road on the map to start drawing. If the road\nbranches off from an existing road, start by clicking on the place where they connect.\n\nThen click on points along the road so that it follows the right path, according\nto satellite imagery or GPS. If the road you are drawing crosses another road, connect\nit by clicking on the intersection point. When you're done drawing, double-click\nor press 'Return' or 'Enter' on your keyboard.\n",
"gps": "# GPS\n\nGPS data is the most trusted source of data for OpenStreetMap. This editor\nsupports local traces - `.gpx` files on your local computer. You can collect\nthis kind of GPS trace with a number of smartphone applications as well as\npersonal GPS hardware.\n\nFor information on how to perform a GPS survey, read\n[Surveying with a GPS](http://learnosm.org/en/beginner/using-gps/).\n\nTo use a GPX track for mapping, drag and drop the GPX file onto the map\neditor. If it's recognized, it will be added to the map as a bright green\nline. Click on the 'Background Settings' menu on the left side to enable,\ndisable, or zoom to this new GPX-powered layer.\n\nThe GPX track isn't directly uploaded to OpenStreetMap - the best way to\nuse it is to draw on the map, using it as a guide for the new features that\nyou add.\n",
"imagery": "# Imagery\n\nAerial imagery is an important resource for mapping. A combination of\nairplane flyovers, satellite views, and freely-compiled sources are available\nin the editor under the 'Background Settings' menu on the left.\n\nBy default a [Bing Maps](http://www.bing.com/maps/) satellite layer is\npresented in the editor, but as you pan and zoom the map to new geographical\nareas, new sources will become available. Some countries, like the United\nStates, France, and Denmark have very high-quality imagery available for some areas.\n\nImagery is sometimes offset from the map data because of a mistake on the\nimagery provider's side. If you see a lot of roads shifted from the background,\ndon't immediately move them all to match the background. Instead you can adjust\nthe imagery so that it matches the existing data by clicking 'Fix alignment' at\nthe bottom of the Background Settings UI.\n",
"addresses": "# Addresses\n\nAddresses are some of the most useful information for the map.\n\nAlthough addresses are often represented as parts of streets, in OpenStreetMap\nthey're recorded as attributes of buildings and places along streets.\n\nYou can add address information to places mapped as building outlines as well\nas well as those mapped as single points. The optimal source of address\ndata is from an on-the-ground survey or personal knowledge - as with any\nother feature, copying from commercial sources like Google Maps is strictly\nforbidden.\n",
"inspector": "# Using the Inspector\n\nThe inspector is the user interface element on the right-hand side of the\npage that appears when a feature is selected and allows you to edit its details.\n\n### Selecting a Feature Type\n\nAfter you add a point, line, or area, you can choose what type of feature it\nis, like whether it's a highway or residential road, supermarket or cafe.\nThe inspector will display buttons for common feature types, and you can\nfind others by typing what you're looking for in the search box.\n\nClick the 'i' in the bottom-right-hand corner of a feature type button to\nlearn more about it. Click a button to choose that type.\n\n### Using Forms and Editing Tags\n\nAfter you choose a feature type, or when you select a feature that already\nhas a type assigned, the inspector will display fields with details about\nthe feature like its name and address.\n\nBelow the fields you see, you can click icons to add other details,\nlike [Wikipedia](http://www.wikipedia.org/) information, wheelchair\naccess, and more.\n\nAt the bottom of the inspector, click 'Additional tags' to add arbitrary\nother tags to the element. [Taginfo](http://taginfo.openstreetmap.org/) is a\ngreat resource for learn more about popular tag combinations.\n\nChanges you make in the inspector are automatically applied to the map.\nYou can undo them at any time by clicking the 'Undo' button.\n\n### Closing the Inspector\n\nYou can close the inspector by clicking the close button in the top-right,\npressing the 'Escape' key, or clicking on the map.\n",
"buildings": "# Buildings\n\nOpenStreetMap is the world's largest database of buildings. You can create\nand improve this database.\n\n### Selecting\n\nYou can select a building by clicking on its border. This will highlight the\nbuilding and open a small tools menu and a sidebar showing more information\nabout the building.\n\n### Modifying\n\nSometimes buildings are incorrectly placed or have incorrect tags.\n\nTo move an entire building, select it, then click the 'Move' tool. Move your\nmouse to shift the building, and click when it's correctly placed.\n\nTo fix the specific shape of a building, click and drag the points that form\nits border into better places.\n\n### Creating\n\nOne of the main questions around adding buildings to the map is that\nOpenStreetMap records buildings both as shapes and points. The rule of thumb\nis to _map a building as a shape whenever possible_, and map companies, homes,\namenities, and other things that operate out of buildings as points placed\nwithin the building shape.\n\nStart drawing a building as a shape by clicking the 'Area' button in the top\nleft of the interface, and end it either by pressing 'Return' on your keyboard\nor clicking on the first point drawn to close the shape.\n\n### Deleting\n\nIf a building is entirely incorrect - you can see that it doesn't exist in satellite\nimagery and ideally have confirmed locally that it's not present - you can delete\nit, which removes it from the map. Be cautious when deleting features -\nlike any other edit, the results are seen by everyone and satellite imagery\nis often out of date, so the road could simply be newly built.\n\nYou can delete a building by clicking on it to select it, then clicking the\ntrash can icon or pressing the 'Delete' key.\n"
},
"presets": {
"fields": {
@@ -1713,9 +1721,6 @@ locale.zh = {
"in": "放大",
"out": "缩小"
},
"imagery": {
"provided_by": "影像由{source}提供"
},
"gpx": {
"local_layer": "本地GPX文件",
"drag_drop": "把GPX文件拖到页面上。"
@@ -2377,6 +2382,12 @@ locale.zh = {
"office": {
"name": "办公室"
},
"other": {
"name": "其他"
},
"other_area": {
"name": "其他"
},
"place": {
"name": "地点"
},
@@ -2904,9 +2915,6 @@ locale.zh_TW = {
"in": "放大",
"out": "縮小"
},
"imagery": {
"provided_by": "影像由 {source} 提供"
},
"gpx": {
"local_layer": "本機GPX檔案",
"drag_drop": "拖放一個.gpx格式的檔案到本頁"
@@ -4237,9 +4245,6 @@ locale.fr = {
"in": "Zoomer",
"out": "Dézoomer"
},
"imagery": {
"provided_by": "Image provenant de {source}"
},
"gpx": {
"local_layer": "Fichier GPX personnel",
"drag_drop": "Glisser et déposer un fichier .gpx sur la page"
@@ -4774,6 +4779,7 @@ locale.de = {
"reset": "Zurücksetzen"
},
"restore": {
"heading": "Ungespeicherte Änderungen vorhanden",
"description": "Es gibt ungespeicherte Änderungen aus einer vorherigen Sitzung. Möchtest du diese Änderungen wiederherstellen?",
"restore": "Wiederherstellen",
"reset": "Zurücksetzen"
@@ -4792,6 +4798,7 @@ locale.de = {
},
"source_switch": {
"live": "live",
"lose_changes": "Es gibt ungespeicherte Änderungen. Durch Wechsel des Karten-Servers, gehen diese verloren. Sind Sie sicher, dass Sie die Server wechseln wollen?",
"dev": "dev"
},
"tag_reference": {
@@ -4811,8 +4818,12 @@ locale.de = {
"in": "Hineinzoomen",
"out": "Herauszoomen"
},
"imagery": {
"provided_by": "Bilddaten von {source}"
"gpx": {
"local_layer": "Lokale GPX-Datei",
"drag_drop": "Eine GPX-Datei per Drag & Drop auf die Seite ziehen"
},
"help": {
"title": "Hilfe"
},
"presets": {
"fields": {
@@ -4831,12 +4842,24 @@ locale.de = {
"aeroway": {
"label": "Typ"
},
"amenity": {
"label": "Typ"
},
"atm": {
"label": "Geldautomat"
},
"bicycle_parking": {
"label": "Typ"
},
"building": {
"label": "Gebäude"
},
"building_area": {
"label": "Gebäude"
},
"building_yes": {
"label": "Gebäude"
},
"capacity": {
"label": "Kapazität"
},
@@ -7010,9 +7033,6 @@ locale.pt = {
"in": "Aproximar",
"out": "Afastar"
},
"imagery": {
"provided_by": "Imagens disponibilizadas por {source}"
},
"gpx": {
"local_layer": "Ficheiro GPX local",
"drag_drop": "Arraste um ficheiro .gpx para a página"
@@ -8502,9 +8522,6 @@ locale.uk = {
"in": "Наблизитись",
"out": "Віддалитись"
},
"imagery": {
"provided_by": "Фон наданий {source}"
},
"gpx": {
"local_layer": "Локальний файл GPX",
"drag_drop": "Перетягніть файл .gpx на сторінку"
@@ -9603,7 +9620,7 @@ locale.vi = {
"truncated_list": "Đang xem các đóng góp của {users} và {count} người khác"
},
"geocoder": {
"title": "Tìm kiếm địa phương",
"title": "Tìm kiếm Địa phương",
"placeholder": "Tìm kiếm địa phương",
"no_results": "Không tìm thấy địa phương với tên “{name}”"
},
@@ -9625,7 +9642,7 @@ locale.vi = {
},
"background": {
"title": "Hình nền",
"description": "Tùy chọn hình nền",
"description": "Tùy chọn Hình nền",
"percent_brightness": "Sáng {opacity}%",
"fix_misalignment": "Chỉnh lại hình nền bị chệch",
"reset": "đặt lại"
@@ -9646,7 +9663,9 @@ locale.vi = {
},
"splash": {
"welcome": "Chào mừng bạn đến với iD, chương trình sửa đổi OpenStreetMap",
"text": "Đây là phiên bản đang phát triển {version}. Xem thêm thông tin tại {website} và báo cáo lỗi tại {github}."
"text": "Đây là phiên bản đang phát triển {version}. Xem thêm thông tin tại {website} và báo cáo lỗi tại {github}.",
"walkthrough": "Mở trình hướng dẫn",
"start": "Tiến hành sửa đổi"
},
"source_switch": {
"live": "thật",
@@ -9670,9 +9689,6 @@ locale.vi = {
"in": "Phóng to",
"out": "Thu nhỏ"
},
"imagery": {
"provided_by": "Hình ảnh do {source} cung cấp"
},
"gpx": {
"local_layer": "Tập tin GPX địa phương",
"drag_drop": "Kéo thả một tập tin .gpx vào trang"
@@ -10368,6 +10384,12 @@ locale.vi = {
"office": {
"name": "Văn phòng"
},
"other": {
"name": "Khác"
},
"other_area": {
"name": "Khác"
},
"place": {
"name": "Địa phương"
},

View File

@@ -61,16 +61,17 @@ function getResource(resource, callback) {
function getLanguage(resource) {
return function(code, callback) {
request.get(resource+ 'translation/' + code, { auth : auth }, function(err, resp, body) {
request.get(resource + 'translation/' + code, { auth : auth },
function(err, resp, body) {
if (err) return callback(err);
callback(null, JSON.parse(body).content);
});
};
}
function getLanguages(resource, callback) {
request.get(resource + '?details', { auth: auth }, function(err, resp, body) {
request.get(resource + '?details', { auth: auth },
function(err, resp, body) {
if (err) return callback(err);
callback(null, JSON.parse(body).available_languages.map(function(d) {
return d.code;

View File

@@ -31,6 +31,7 @@
<script src='js/lib/bootstrap-tooltip.js'></script>
<script src='js/lib/rtree.js'></script>
<script src='js/lib/togeojson.js'></script>
<script src='js/lib/marked.js'></script>
<script src='js/id/id.js'></script>
<script src='js/id/util.js'></script>

View File

@@ -24,8 +24,26 @@ iD.ui.Help = function(context) {
});
}
var docKeys = [
'help.help',
'help.editing_saving',
'help.roads',
'help.gps',
'help.imagery',
'help.addresses',
'help.inspector',
'help.buildings'];
function one(f) { return function(x) { return f(x); }; }
var docs = docKeys.map(one(t)).map(function(text) {
return {
title: text.split('\n')[0].replace('#', '').trim(),
html: marked(text.split('\n').slice(1).join('\n'))
};
});
var menuItems = toc.selectAll('li')
.data(iD.data.doc)
.data(docs)
.enter()
.append('li')
.append('a')
@@ -47,7 +65,7 @@ iD.ui.Help = function(context) {
body = content.append('div')
.attr('class', 'body');
clickHelp(iD.data.doc[0]);
clickHelp(docs[0]);
}
function hide() { setVisible(false); }

1127
js/lib/marked.js Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -22,7 +22,7 @@ toGeoJSON = (function() {
return o;
}
function fc() { return { type: 'FeatureCollection', features: [] }; }
t = {
var t = {
kml: function(doc, o) {
o = o || {};
var gj = fc(), styleIndex = {},

View File

@@ -29,8 +29,5 @@
},
"engines": {
"node": "~0.8.20"
},
"dependencies": {
"marked": "~0.2.8"
}
}

View File

@@ -73,8 +73,6 @@ describe('iD.presets.Preset', function() {
describe('#applyTags', function() {
it("adds match tags", function() {
console.log(p['highway/residential']);
console.log(p['highway/residential'].applyTags({}, 'area'));
expect(p['highway/residential'].applyTags({}, 'area')).to.eql({ highway: 'residential' });
});