cyclestreets / cyclestreets/bikedata

URL persistency

Open
#2 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
18
Forks
2
PR merge metrics
No merged PRs in 30d

Description

There needs to be some scheme for URL persistency, covering all the various interaction controls, so that someone will be able to construct a view, and then the URL without needing any special action.

User actions which should result in different URLs are:

  • Enabling/disabling various layers
  • Setting various options in the layer(s). This could potentially be quite a long list.
  • Drawing a boundary (or in future boundaries potentially)
  • Panning the map (though there is a Leaflet.js plugin which attaches the location as a hash, so that is already fine)

There is already some work in place which allows the key thing - layers, to be set, e.g.
/collisions
/cycleparking,planningapplications (which would enable both)

However, these two are not enough because of the layer options requirement, and that could generate long URLs.

One approach is that every interaction results in an AJAX request for a shortlink, e.g. /msln648a though this isn't very self-explanatory. It would need a server-side database storage and could generate a lot of items in the database that are never used. This could be optimised by re-using existing combinations. E.g. common use case might be collisions (with type=serious) plus pollution. That combination could then be re-used each time.

This will almost certainly need to involve the HTML5 push/history API, so that the URL changes dynamically, and not a require a "get permalink" control which most people would miss:
http://html5doctor.com/history-api/

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing layer URL scheme, including /collisions and /cycleparking,planningapplications, then examine the Leaflet.js hash behavior and the HTML5 History API reference linked in the issue. The work is done when layer and option changes, boundary drawing, and map movement can be represented by a shareable URL without a separate permalink action.

Written by the indexing model from the issue text.

Assessment

Tech stack
html, javascript
Domain
frontend, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.