Comments (11)
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.
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.
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.
Thanks; now rolled out and works nicely - thanks.
from cyclescape.
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.
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.
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.
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.
Ok, I'm going on the side of caution and have added e3af511 which will try:
- the issues location (including deleted issues)
- the groups location
- the created by users location
- a random location (as a fall back)
from cyclescape.
You can have groups without a location, thus the easter egg/random location is still required.
from cyclescape.
Thanks; now rolled out.
from cyclescape.
Related Issues (20)
- Admins of a group should be able to censor a message HOT 4
- Deadline not shown when creating issue HOT 6
- Improve visibility of delayed approved messages
- Issue elimination - database migration HOT 8
- Autosave editor content every few seconds
- Photo orientation problem
- Message links don't always work as expected HOT 3
- Message moderation should not apply to members of long standing
- Private message alerts not shown in toolbar HOT 1
- Odd right click pop up box HOT 6
- Cyclestreets calendar invites providing the wrong thread link
- Some threads still showing as unread after reading HOT 8
- Older threads marked as favourites do not have dates attached
- Replace Java-based search engine with Postgresql full-text search
- Upgrade to Rails 6.2
- Appearance of moderated message in two digests
- Latest message not saved
- Member getting this code when trying to follow Cyclescape thread url
- Text formatting lost
- Back to top arrow non functional on laptop
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cyclescape.