#6 General cleanup of the frontend js code

Open
opened 9 years ago by zorun · 1 comments
zorun commented 9 years ago

The current js code is a mess. Some specific issues:

  • it should use the json API to get information about the panorama to display, instead of using javascript variable generated from a template.

  • it is primarily designed for 360° pictures, and does not handle non-360° pictures very well (see issue #1).

  • it implements its own tile display logic, while there probably are libraries to do that.

  • there are multiple systems of coordinates, with conversions between them:

    • the backend uses absolute pixel coordinates (x/y) to refer to points in an image.
    • the frontend uses relative coordinates (x between 0 and 1, y between -0.5 and 0.5) to refer to points in an image.
    • the frontend also uses screen-based coordinates, in pixels. The relation between screen coordinates and image coordinates depends on the zoom level and the current position in the image, and wraps around for 360° images.
    • both frontend and backend also manipulate azimuth and elevation (but that's the point of celutz)
The current js code is a mess. Some specific issues: * it should use the json API to get information about the panorama to display, instead of using javascript variable generated from a template. * it is primarily designed for 360° pictures, and does not handle non-360° pictures very well (see issue #1). * it implements its own tile display logic, while there probably are libraries to do that. * there are multiple systems of coordinates, with conversions between them: * the backend uses absolute pixel coordinates (x/y) to refer to points in an image. * the frontend uses relative coordinates (x between 0 and 1, y between -0.5 and 0.5) to refer to points in an image. * the frontend also uses screen-based coordinates, in pixels. The relation between screen coordinates and image coordinates depends on the zoom level and the current position in the image, and wraps around for 360° images. * both frontend and backend also manipulate azimuth and elevation (but that's the point of celutz)
Alexandre commented 8 years ago
Collaborator

Also there is jQuery included, but there are some plain old Javascript codes that could be removed by using jQuery utilities (eg. $.getJSON() instead of getXMLHttpRequest()).

Also there is jQuery included, but there are some plain old Javascript codes that could be removed by using jQuery utilities (eg. `$.getJSON()` instead of `getXMLHttpRequest()`).
Sign in to join this conversation.
No Label
bug
ui
No Milestone
No assignee
2 Participants
Loading...
Cancel
Save
There is no content yet.