Giter VIP home page Giter VIP logo

openstreetmap / openstreetmap-website Goto Github PK

View Code? Open in Web Editor NEW
2.0K 103.0 897.0 456.83 MB

The Rails application that powers OpenStreetMap

Home Page: https://www.openstreetmap.org/

License: GNU General Public License v2.0

Ruby 78.16% JavaScript 7.02% HTML 8.30% CSS 0.01% Shell 0.08% C 0.23% C++ 0.77% Perl 0.26% SCSS 1.35% Dockerfile 0.07% PLpgSQL 3.74%
openstreetmap rails-application ruby

openstreetmap-website's People

Contributors

aaronlidman avatar antonkhorev avatar apmon avatar avar avatar bhousel avatar crschmidt avatar dankarran avatar dependabot[bot] avatar firefishy avatar gravitystorm avatar ignoredambience avatar jfirebaugh avatar jguthrie100 avatar john07 avatar mmd-osm avatar nikerabbit avatar quincylvania avatar saintamh avatar samanpwbb avatar siebrand avatar simonpoole avatar smsm1 avatar stefanb avatar stevec avatar systemed avatar tmcw avatar tomhughes avatar translatewiki avatar woodpeck avatar zerebubuth 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  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  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  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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openstreetmap-website's Issues

Increase cachablility for individual OSM elements on the API

Currently, OSM objects in the API appear at /api/.../{node|way|relation}/id

and there is /api/.../{node|way|relation}/id/version

A specific object version is immutable. Once an object is set, it cannot be modified under the same version.

This means that this url is completely cachable. I believe we specify that cacheablity now in the headers, if not- we should.

Unfortunately, most per-object calls do not include the version number, so they cannot be cached.

I suggest that the non-versioned call return a HTTP 303 (See Other) call which directs the http client to the current version.

This would also effect the .../full call, which would need to be modified sightly to support the new format.

Zoom Control

Summary:
The current Zoom control does not in any way fit into the rest of the web site.

  1. The web site's style is built around solid, rectangular blocks of colour, the zoom control uses curved edges, and greys
  2. The web site doesn't use drop shadows for anything other than the zoom control.

Potential Fix:
Note that the direction arrows are simply removed, as they're basically useless except on the mobile site which already has a sane style.
Unselected Zoom control
Selected Zoom control
Mock Up

Remove 'home' link

Like the 'where am I?' link, this is quite confusing and would make more sense if it were just an geolocation button on the map.

osm.org hangs when zooming in opera

opera 12.10 on linux.

opening osm.org and zooming in/out with the moousewheel a few times hangs the map area. links and other elements on the page work ok. panning does not seem to cause this issue.
no javascript errors reported.
worked ok some time ago :)

once frozen, + and - buttons do not work either. clicking on the zoom indicator bar changes the bar, but not the zoom itself.

clicking on the panning buttons unfreezes the map area

Finish JSON API

I/we want to finish the JSON API work initially prototyped by Jeff Warren.

Basically this consists of adding & testing the json format from Rails, implementing this in cgimap if needed, and scoping out supporting GeoJSON on some calls so that the API results are more easily usable.

Rename

Okay, how about this one... 'Rails port' is devoid of meaning to any newcomers, and really doesn't matter that much at this point (when was it ported? from what?).

I submit that it could be called osm-website or osm-application.

rails-dev list, discuss.

PG::Error: ERROR when running migrations

== AddMoreChangesetIndexes: migrating ========================================
-- add_index("changesets", ["created_at"], {:name=>"changesets_created_at_idx"})
-> 0.0017s
-- add_index("changesets", ["closed_at"], {:name=>"changesets_closed_at_idx"})
-> 0.0015s
-- add_index("changesets", ["min_lat", "max_lat", "min_lon", "max_lon"], {:name=>"changesets_bbox_idx", :method=>"GIST"})
rake aborted!
An error has occurred, this and all later migrations canceled:

PG::Error: ERROR: data type integer has no default operator class for access method "gist"
HINT: You must specify an operator class for the index or define a default operator class for the data type.
: CREATE INDEX "changesets_bbox_idx" ON "changesets" USING GIST ("min_lat", "max_lat", "min_lon", "max_lon")

Tasks: TOP => db:migrate
(See full trace by running task with --trace)

Changeset browser behaviour change

The leaflet port has changed the behaviour of the changeset browser - previously hovering over the outine of a changeset on the map would highlight it but now hovering anywhere over the changeset triggers the highlight.

This makes selecting a changeset harder where there are overlapping changesets.

Problem with rake db:migrate

Hello.
I attempt to install a local copy of a osm-website on the server under
FreeBSD 8.2.
To be exact, I try to upgrade the rails port v2.* to v3.* by the full installation.
However now, on a step 'rake db:migrate' I receive a following error:

rake db:migrate
== CreateCountries: migrating ================================================
-- innodb_table()
-> 0.0001s
-- create_table(:countries, {:options=>"", :force=>true, :id=>false})
NOTICE: CREATE TABLE will create implicit sequence "countries_id_seq" for serial column "countries.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "countries_pkey" for table "countries"
-> 0.0110s
-- add_index(:countries, [:code], {:unique=>true, :name=>"countries_code_idx"})
-> 0.0035s
rake aborted!
An error has occurred, this and all later migrations canceled:

Can't mass-assign protected attributes: code, max_lon, min_lat, max_lat, min_lon

Tasks: TOP => db:migrate
(See full trace by running task with --trace)

Can somebody tell me what it is possible to make to correct this error?

Thank you,
Sergey

Replace "Reading your messages" heading with subject of message or something more sensible

I just came by a wacky interface message translation on Translatewiki, and found out that the original wasn't much better.

The Reading your messages heading in the messaging system should be replaced with the subject of the message (like in Gmail, and probably other messaging systems) or something that makes more sense / is simpler.

Who's "reading your messages"? I am ... reading ... my messages perhaps. Or is OSM reading my messages, anyway looks very awkward.

Upgrade to Ruby 1.9

I've just done a quick test of the full relation API, and 1.9.3 was twice as fast as 1.8.7:

https://gist.github.com/3933830

Upgrading to 1.9 would give us significant performance improvements without code changes or porting more of the API to C++.

Geolocation for main map

It would be great, if the main map on the OpenStreetMap website showed a "geolocate me" button using the W3C geolocation. For this feature, an OpenLayers example exists on http://openlayers.org/dev/examples/geolocation.html. User SamatJain blogged about this some time ago: http://www.openstreetmap.org/user/SamatJain/diary/11287

When adding this feature, one should clarify the "Where am I?" link (which reverse-geolocates the current map position) – I have always been expecting the geolocation feature.

Filtering the output of the `map` API endpoint

The core API should support XAPI-style nodes-only, ways-only, etc queries. This might not be the same scope as XAPI, and as a read/write API has more issues, but I'm cool to look through them and see if this would work.

This would constitute a real benefit to limited editors, so that they can pull data from dense areas (read cities) and just edit the data they present (read POIs)

Also, this may be implemented in cgimap instead - @TomH & @zerebubuth have the wisdom there.

Test

This is a test issue

Use hash-based permalinks

Instead of

http://www.openstreetmap.org/?lat=38&lon=-95.8&zoom=4&layers=M

We should be able to support

http://www.openstreetmap.org/#lat=38&lon=-95.8&zoom=4&layers=M

These should have the benefit of never hitting the rails app and just going to cache (sidenote: what's the caching infrastructure for OSM? Is this going straight to Apache?)

OpenStreetBugs aka Notes

I updated the openstreetbugs branch a bit, but before I continue to work on it I want to ask whether that feature is still desired?

Remove the LTR stylesheet

We should get rid of the LTR stylesheet, write LTR styles in the common stylesheet, then override LTR's with an RTL stylesheet. This makes writing CSS a lot simpler.

@tomhughes do you have any objections to this?

Removing 'active' column breaks osmosis

osmosis --read-xml-0.6 file="RU-VGG.osm.bz2" --write-apidb-0.6 populateCurrentTables=yes host="localhost" database="openstreetmap" user="openstreetmap" password="openstreetmap" validateSchemaVersion=no

outputs error:

...
SEVERE: Thread for task 1-read-xml-0.6 failed
...
Caused by: org.postgresql.util.PSQLException: ERROR: column "active" of relation "users" does not exist
...

The reason is migration 051_add_status_to_user.rb

Are old_*_controller.rb still needed?

There are a number of models and controllers like

  old_controller.rb
  old_node_controller.rb
  old_relation_controller.rb
  old_relation_member_controller.rb
  old_way_controller.rb
  old_way_node_controller.rb

Are these still needed? Are they used by some API?

Improve language switching

It looks like the only way to change language currently is:

(I might be wrong about this, feel free to correct).

This could be improved, aka replaced with a select-list which has full language names as well.

unminify OpenLayers.js

The asset pipeline will handle minification, and it's nice to have the unminified version for debugging purposes in the development environment.

I'd submit a pull request, but I'm not sure exactly what OL version is being used.

image export from nonstandard map

When I choose a nonstandard map layout, say bicycle layout
and export a map into an image format,
the image of the map is in the standard layout.

The crucial lines seem to be in ExportController#finish where there's a redirect to

"http://parent.tile.openstreetmap.org/cgi-bin/export?bbox=#{bbox}&scale=#{scale}&format=#{format}"

No info on the map layout is passed.

Error: Display Name is invalid

The error "Display Name is invalid" while registering might not be too helpful. Instead, display which characters are not allowed (I'm not completely sure about the handling of \/):

diff --git a/app/models/user.rb b/app/models/user.rb
index 3b43130..27662f1 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -36,7 +36,7 @@ class User < ActiveRecord::Base
   validates_length_of :display_name, :within => 3..255, :allow_nil => true
   validates_email_format_of :email, :if => Proc.new { |u| u.email_changed? }
   validates_email_format_of :new_email, :allow_blank => true, :if => Proc.new { |u| u.new_email_changed? }
-  validates_format_of :display_name, :with => /^[^\/;.,?%#]*$/, :if => Proc.new { |u| u.display_name_changed? }
+  validates_format_of :display_name, :with => /^[^\/;.,?%#]*$/, :message => "contains invalid characters (\/;.,?%#)" :if => Proc.new { |u| u.display_name_changed? }
   validates_format_of :display_name, :with => /^\S/, :message => "has leading whitespace", :if => Proc.new { |u| u.display_name_changed? }
   validates_format_of :display_name, :with => /\S$/, :message => "has trailing whitespace", :if => Proc.new { |u| u.display_name_changed? }
   validates_numericality_of :home_lat, :allow_nil => true

Eliminate style_rules helper

This helper in app/helpers/application_helper.rb could be implemented with better html & css structuring - adding conditionals to erb or adding classes to the body tag for admin-users.

Clean up views, move javascript to files

This is a good starter task:

  • app/views/site/index.html.erb has lots of JS & Ruby logic which should be pushed into Javascript files, ruby controllers & helpers. The JS also could use serious refactoring and cleanup

Big views:

loc
  73 app/views/message/read.html.erb
  75 app/views/diary_entry/edit.html.erb
  78 app/views/export/start.html.erb
  83 app/views/changeset/_map.html.erb
  84 app/views/user/login.html.erb
  91 app/views/site/_potlatch2.html.erb
  91 app/views/user/_map.html.erb
  92 app/views/browse/_changeset_details.html.erb
  92 app/views/changeset/list.atom.builder
 100 app/views/user/new.html.erb
 138 app/views/user/account.html.erb
 141 app/views/user/view.html.erb
 150 app/views/layouts/site.html.erb
 156 app/views/browse/_map.html.erb
 303 app/views/site/index.html.erb

/cc @lxbarth

Strange + and - characters on zoom controls

Don't know if it is just me, but on the "+" and "-" zoom controls there seems to be a small "+"/"-" text character overlaid on the graphic, which (if you look closely) gains an underline on a mouseover.

Map does not load in IE8

Javascript error at line 884 in leaflet.js. Stack goes something like this (IE debugging tools SUCK):

leaflet.zoom.js:126    L.DomUtil.setPosition(this._knob, new L.Point(0, y));
leaflet.zoom.js:24     this._snapToSliderValue();
map.js:91              new L.Control.Zoomslider({stepHeight: 7}).addTo(map);
index.js:9             var map = createMap("map");

Improve first-edit guidance

New accounts should have more cues:

  • When a user doesn't have any edits, we should have a block that explains what editing is, how to do it, etc.
  • If they don't have friends, it should encourage them to search for nearby mappers and explain what a mapping party is.

This is an intermediate task - requires some localization and a bit of erb-wrangling.

way/:id/full/history

Trying to look at the history of the geometry of a way is difficult. Doing so means that a client would need to call a way's history, then retrieve node history for each node.

This means a lot of requests to the server.

If the server could return a full history that included all the versions of all the way, along with all the history of the nodes ever in that way, this would make generating a geometry history much easier and less expensive to the server in terms of reducing the number of calls.

HTML5?

Currently the Rails Port declares itself as XHTML 1.0 Transitional. I think we should go for <!DOCTYPE html> to fall in line with the majority of the internets, unless there's a reason not to.

The main reason not too would be, maybe, if OpenLayers vector features break since this might cause the compatibility mode in IE to change.

Clarify license

Right now there's no LICENSE file in this repo, mention of license on the osm wiki page or in the README. After finding out what it is :) it should be added somewhere.

Move license attribution to standard OpenLayers control

This will be a two-fer - permalink should move to the left of the layers dialog and be turned into an icon with a more user-friendly text field where you can copy & paste the url rather than 'going to it', and in the space left there, the default attribution.

People expect attribution on the map in roughly that spot, and this makes the transition between the main Mapnik layer and the other layers clearer.

requirements: OpenLayers, template hacking, hacking the sprite

Taginfo-esque API

Being able to get simple output for tagging - analysis like 'top 10 values of x tag' or such would be massive to help editors autocomplete tag information and highlight tags that are less recommended.

This has unknown performance implications; maybe it could be naively implemented with rails counters, or it might require some more strong magic.

Allow language switching without being logged in

From #132 it should be possible for users to get localized versions of OpenStreetMap.org. This is primarily a design problem - we need screen real estate and a good way to present this. Secondarily this might include automatic detection of language, but that would be after the first push.

Zoomworld button on the small osm.org page

Hello, I hope this is the right place for this issue.

The smaller version of the openstreetmap.org site (when width < x pixels) has a zoomworld button between the + and - zoom buttons. I think this button doesn't have a real purpose, and if you browse the site on a touch-screen device it is very easy to touch it accidentally. It is quite frustrating, and the solution is simple. Just remove it :)

Thanks for all the work done here,
Janko Mihelić

rake test's failures and errors

Hello.
After the installation 'rake test' has given following failures and errors:

link called at /usr/local/lib/ruby/gems/1.8/gems/actionpack-3.2.6/lib/action_view/helpers/atom_feed_helper.rb:146:in `send'

E.......F....F.F.................F...........................................................................................FFF...........................................................
Finished in 175.081784 seconds.

  1. Error:
    test_feed(ChangesetControllerTest):
    ActionView::Template::Error: wrong number of arguments (1 for 2)
    app/views/changeset/list.atom.builder:25:in _app_views_changeset_list_atom_builder___861221088_17571292720' app/views/changeset/list.atom.builder:24:in_app_views_changeset_list_atom_builder___861221088_17571292720'
    app/views/changeset/list.atom.builder:23:in _app_views_changeset_list_atom_builder___861221088_17571292720' app/views/changeset/list.atom.builder:4:in_app_views_changeset_list_atom_builder___861221088_17571292720'
    app/controllers/changeset_controller.rb:335:in list' app/controllers/changeset_controller.rb:342:infeed'
    app/controllers/application_controller.rb:330:in web_timeout' app/controllers/application_controller.rb:329:inweb_timeout'
    test/functional/changeset_controller_test.rb:1767:in `test_feed'

  2. Error:
    test_feed_user(ChangesetControllerTest):
    ActionView::Template::Error: wrong number of arguments (1 for 2)
    app/views/changeset/list.atom.builder:25:in _app_views_changeset_list_atom_builder___861221088_17571292720' app/views/changeset/list.atom.builder:24:in_app_views_changeset_list_atom_builder___861221088_17571292720'
    app/views/changeset/list.atom.builder:23:in _app_views_changeset_list_atom_builder___861221088_17571292720' app/views/changeset/list.atom.builder:4:in_app_views_changeset_list_atom_builder___861221088_17571292720'
    app/controllers/changeset_controller.rb:335:in list' app/controllers/changeset_controller.rb:342:infeed'
    app/controllers/application_controller.rb:330:in web_timeout' app/controllers/application_controller.rb:329:inweb_timeout'
    test/functional/changeset_controller_test.rb:1782:in `test_feed_user'

  3. Failure:
    test_read(ChangesetControllerTest) [test/functional/changeset_controller_test.rb:167]:
    Expected exactly 1 element matching "osm[version='0.6'][generator='OpenStreetMap server']", found 0.
    is not true.

  4. Failure:
    test_upload_create_valid(ChangesetControllerTest) [test/functional/changeset_controller_test.rb:400]:
    Expected exactly 1 element matching "diffResult[version='0.6'][generator='OpenStreetMap server']", found 0.
    is not true.

  5. Failure:
    test_upload_delete_if_unused(ChangesetControllerTest) [test/functional/changeset_controller_test.rb:606]:
    Expected exactly 1 element matching "diffResult[version='0.6'][generator='OpenStreetMap server']", found 0.
    is not true.

  6. Failure:
    test_upload_xml_errors(ChangesetControllerTest) [test/functional/changeset_controller_test.rb:1182]:
    Expected exactly 1 element matching "osmError[version='0.6'][generator='OpenStreetMap server']", found 0.
    is not true.

  7. Failure:
    test_relations_for_node(RelationControllerTest)
    [test/functional/relation_controller_test.rb:94:in check_relations_for_element' test/functional/relation_controller_test.rb:71:intest_relations_for_node']:
    Expected exactly 1 element matching "osm[version='0.6'][generator='OpenStreetMap server']", found 0.
    is not true.

  8. Failure:
    test_relations_for_relation(RelationControllerTest)
    [test/functional/relation_controller_test.rb:94:in check_relations_for_element' test/functional/relation_controller_test.rb:83:intest_relations_for_relation']:
    Expected exactly 1 element matching "osm[version='0.6'][generator='OpenStreetMap server']", found 0.
    is not true.

  9. Failure:
    test_relations_for_way(RelationControllerTest)
    [test/functional/relation_controller_test.rb:94:in check_relations_for_element' test/functional/relation_controller_test.rb:77:intest_relations_for_way']:
    Expected exactly 1 element matching "osm[version='0.6'][generator='OpenStreetMap server']", found 0.
    is not true.

270 tests, 3313 assertions, 7 failures, 2 errors
Loaded suite /usr/local/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/rake_test_loader
Started
................F.......................
Finished in 222.101461 seconds.

  1. Failure:
    test_user_create_success(UserCreationTest)
    [test/integration/user_creation_test.rb:62:in test_user_create_success' test/integration/user_creation_test.rb:61:intest_user_create_success'
    test/integration/user_creation_test.rb:58:in each' test/integration/user_creation_test.rb:58:intest_user_create_success']:
    "ActionMailer::Base.deliveries.size" didn't change by 1.
    <1> expected but was
    <0>.

40 tests, 2867 assertions, 1 failures, 0 errors
Errors running test:functionals! #<RuntimeError: Command failed with status (1): [/usr/local/bin/ruby18 -I"lib:test" -I"/usr...]>
Errors running test:integration! #<RuntimeError: Command failed with status (1): [/usr/local/bin/ruby18 -I"lib:test" -I"/usr...]>

What it is possible to make to correct it?

Thank you,
Sergey

Sidebar styling cleanup

The sidebar is one of the strongest candidates for style de-duplication - the browse, geocoder, and mapkey styles could be unified and greatly improved.

This is a good starter task - just involves touching erb & common.css.scss.

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.