GithubHelp home page GithubHelp logo

Comments (11)

mvl22 avatar mvl22 commented on July 25, 2024

The code to display a Street View panel, and then capture the location once the user has interactively changed the position is here:

https://developers.google.com/maps/documentation/javascript/examples/streetview-events

which looks fairly easy.

from cyclescape.

mvl22 avatar mvl22 commented on July 25, 2024

This is now live, but it's clear to me that one further iteration is going to be needed for full usage.

On the main Google website, when using Street View, there is a small window in the corner, that lets you drag the 'Street View person' around, so that you can jump easily to a location which isn't so near.

I think this shows the same thing, albeit with a massive map instead of a smaller one.
https://developers.google.com/maps/documentation/javascript/examples/streetview-simple

I think this is unfortunately necessary, as the second time I've tried to use this useful new facility, here:
http://camcycle.cyclescape.org/threads/1818
results in being stuck in the nearby cemetery with no way to get out of it.

Similarly, with an area-wide issue, one would have to do a lot of clicking to get from the centre-point of Cambridge to wherever the wanted location is.

A third example of why it's needed is that if talking about a thread in one place, but you want to illustrate a similar location elsewhere in the UK/beyond, this isn't possible at present.

So the ability to jump to another place on the map would be good.

from cyclescape.

nikolai-b avatar nikolai-b commented on July 25, 2024

Yes, fully agree. As this is a view change only from a new feature I've pushed afe7f65 straight to master. Let me know if you like it!

from cyclescape.

mvl22 avatar mvl22 commented on July 25, 2024

Thanks; now rolled out and works nicely - thanks.

from cyclescape.

mvl22 avatar mvl22 commented on July 25, 2024

http://camcycle.cyclescape.org/threads/227
is giving error 500 now - can't see why it's happening only on this thread though:

Completed 500 Internal Server Error in 1396.4ms

ActionView::Template::Error (undefined method `centre' for nil:NilClass):
    14:       = f.action :submit, button_html: {class: "btn-green"}
    15: 
    16: :javascript
    17:   var svLatNew = #{@issue.centre.x};
    18:   var svLongNew = #{@issue.centre.y};
  app/views/message/street_views/_new.html.haml:17:in `_app_views_message_street_views__new_html_haml__29791032691838047_41305760'
  app/views/messages/_new.html.haml:50:in `_app_views_messages__new_html_haml__736138200415199587_70068040378700'
  app/views/message_threads/show.html.haml:33:in `_app_views_message_threads_show_html_haml__4453352178857280412_70068036132560'

from cyclescape.

nikolai-b avatar nikolai-b commented on July 25, 2024

Looks like that issue doesn't have a thread. This is probably because some admin has deleted it. From the code it looks like threads don't have to have an issue. Do you know why?

Although I have access to the server I don't have admin rights so can't log into rails to see if there are more threads without issues. For now I've just pushed 4bb6bbe which hides street view if the thread has no issues.

from cyclescape.

mvl22 avatar mvl22 commented on July 25, 2024

Ah, yes, of course, that will be the problem.

Administrative threads (Discussion threads > Administrative discussions) can have no issue. This is for stuff like organising meetings, etc.

It is still useful to have Street View as a reply type, and I think we should avoid inconsistencies of this kind.

I think a much better fix will be to set the centre-point of the group's area if it is a group-owned thread, or some specific location if it is not. In the latter case, I suggest the specific location be like an easter egg which has some significance to cycling. However, as I can't think of one, let's just put it at 10 Downing Street, London, for now.

(I've rolled out the current fix for now - thanks.)

from cyclescape.

mvl22 avatar mvl22 commented on July 25, 2024

Ah, actually, it's simpler than that as (I'm pretty sure) you can't have administrative threads that aren't attached to a group. So just take the group's location's centrepoint for administrative threads.

from cyclescape.

nikolai-b avatar nikolai-b commented on July 25, 2024

Ok, I'm going on the side of caution and have added e3af511 which will try:

  1. the issues location (including deleted issues)
  2. the groups location
  3. the created by users location
  4. a random location (as a fall back)

from cyclescape.

smsm1 avatar smsm1 commented on July 25, 2024

You can have groups without a location, thus the easter egg/random location is still required.

from cyclescape.

mvl22 avatar mvl22 commented on July 25, 2024

Thanks; now rolled out.

from cyclescape.

Related Issues (20)

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.