-
-
Notifications
You must be signed in to change notification settings - Fork 833
Conversation
Can one of the admins verify this patch? |
@@ -337,9 +337,6 @@ module.exports = React.createClass({ | |||
}, | |||
*/ | |||
]; | |||
|
|||
var syncedSettings = UserSettingsStore.getSyncedSettings(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm, why are you killing the generic user settings UI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'd expect that supporting location sharing would be precisely the sort of thing that the generic settings code would be good for. (or possibly hiding it behind a labs option for now)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I might leave it in labs for now.
}, | ||
|
||
componentDidMount: function() { | ||
const leafletMap = new Leaflet.Map(this.refs.map); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please can haz consistent indentation? O:-)
}, | ||
|
||
renderMap: function () { | ||
const zoom = ZOOM_STREET; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again, 4 spaces for indentation please
const uri = `https://www.openstreetmap.org/#map=${ZOOM_STREET}/${parts[0]}/${parts[1]}`; | ||
this.setState({uri, coords, body: content.body}); | ||
} else { | ||
this.setState({error: "Mising required fields."}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*Missing
Modal.createDialog( | ||
ErrorDialog, { | ||
title: "Post Location", | ||
description: "You either have disabled location in the browser, or it isnt supported.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*isn't
@@ -274,6 +316,15 @@ export default class MessageComposer extends React.Component { | |||
</div> | |||
); | |||
|
|||
const locationButton = ( | |||
// Add option for either current or specifed location. | |||
// TODO: Add icon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, in practice we probably are going to want a generic + button or something which provides a popup for the more exotic stuff like push-to-talk, locations, etc. But we can handle that!
from quick inspection this is looking insanely cool :) there are few minor cosmeticish things in review comments, one wtf concerning generic settings, and i haven't actually tried using it yet. One important thing: what is your proposed format for
...but do we support formatted bodies here? The Right solution to this would be to use the long-awaited "human representation of events" stuff to associate formatted bodies with the metadata, i suspect, but happy to ignore this for now; just want it clarified so we can spec it! |
Okay, that should be all the minor issues taken care of. The spec is kinda lacking with what I had in mind.
Has a few problems where I'd assume you'd want body and formatted_body to give some sort of representation to clients that do not support
I think having a separate Up to you if you want to merge this first or change the spec first :) |
happy to add it to spec later. the format looks good, although we may wish to finally implement the "human representation of events" stuff from https://docs.google.com/document/d/1cLSlMZ0tulRJM4ki-ImQ_z6DSySQgTRafO2m13RtgZo/edit#heading=h.6azo8zlrfebi to handle thumbnails & body representation etc of the Going to test this locally and then merge so folks can experiment in labs! |
Looks like there are some uncommitted resources here... e.g. img/marker-icon.png (or from the other PR, perhaps). Otherwise, the only other weirdness is the width of the caption entry form on the map preview (but that's just cosmetic). Are you sure that the thumbnails in the timeline should be interactively zoomable? They trap the mouse as you scrollwheel the page and start zooming the image rather than the page. I wonder if opening OSM (or opening a lightbox) would be better when you click on them, to let the user properly navigate... |
Should be in riot-web, but apparently I didn't add them. Will do so. done
Yeah, that and a margin would be nice. I'll see if I can adjust it a bit.
What I might end up doing here is thumbnailing the map at the sender end, and then opening a lightbox for an interactive version. |
right. for compatibility with other matrix clients I'd definitely suggest including a link to OSM in the caption (both HTML & plaintext for compatibility), and ideally thumbnailing it at the sender as you suggest. (this is a really good example of why the 'human representation' event stuff is needed, imo, although given the final soln hasn't been picked there yet we can fudge it with body/formatted_body/thumbnail etc for now) |
Thumbnailing is proving more challenging than anticipated. I originally assumed you could draw any element onto a canvas (and then upload that as a thumb), but I'm limited to images and videos 🤦♂️ . |
does OSM not provide a "just give me an image" API? |
Only provides tiles :/. It's up to the client to assemble them which is a bit of a pain and why we're using leaflet in the first place :(. Would it be cool if we could conveniently leave off thumbnails for the time being (since they aren't strictly required) until I can figure out what the best solution it? |
Make the events conform more to the spec.
c418e14
to
9a2c449
Compare
(New commits because my branch got manged after two months 😢 ) Added support for thumbnails for users that don't wish to display maps. We can render them in the browser :) |
9a2c449
to
f0e1c13
Compare
It was brought up that this might throw a lot of traffic at OSM's servers, particularly in busy rooms. While I can somewhat limit this with thumbnails until hover/click, it might be a better idea for riot to host it's own tile server? |
A few random thoughts: When sharing a point, the level of precision the user intends may vary wildly. Are they referring to a specific county in south-east Kansas, or the entire USA? Which should be displayed? It might be good to encode a hint regarding this in the event--perhaps a radius around the point that should be enclosed by the view area of a map tool? Alternatively, the event could contain arbitrary geometry, for example using GeoJSON (which can be easily fed to most standard GIS or web mapping tools). That way people can send sets of points (favorite restaurants!), polygons (geocache zones!), line strings (travel routes!), or whatever else strikes their fancy. |
I like this one more. Seems like a good idea to be included into the spec as an alternative key. |
matrix-org/matrix-spec-proposals#919 will hopefully widen our scope with regards to what we can do with location events :) |
some of these are probably due to it needing merging to current develop |
expects the marker-icon and marker-shadow to be in /img/$1 even if riot is in a subdir |
Update branch to latest develop
Button visibility + marker image paths
if (!UserSettingsStore.isFeatureEnabled('inline_maps')) { | ||
locationButton = null; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typically the pattern for these is
let locationButton;
if (UserSettingsStore.isFeatureEnabled('inline_maps')) {
locationButton = ();
}
just for the sake of consistency pls
I am not sure this is a proper place for this comment however I would also like to have current location in profile or something very similar. So for example I can request the precise location of my direct chat partner if they allow me to do that. However I don't want all these location requests in the room timeline if possible. I am thinking that it might somehow complement users presence i.e. last seen %(relativeTime)s ago, near %(approxPlace)s or at %(exactSpot)s if allowed.
Of course this should all be optional with proper privacy controls and warnings. And of course it would be even more usefull if mobile apps were also sending location aware presence events if allowed. |
@pvagner indeed this may very well be the wrong place to discuss this. Yet since what you say is most interesting, I guess together with #3545 a geoindex on top of matrix messages, even allowing for NEAR searches would be something additional. http://owntracks.org/ comes to mind here. We may in the end need a separate issue for a geo-aware indexing of Matrix messages et al. and would like to wait for suggestions of the maintainers to where and how this could be scoped. |
Got another thing that might be worth keeping in mind for future flexibility: location streaming. Not sure if that deserves another event type or if could be done with m.location events. |
Thanks for making this contribution a while back. Since the code base has changed since this was opened, it no longer applies cleanly, and I don't think there's a need to keep it open in this state, as we can always find the code here again if needed. If you are still interested in pursuing this feature, please discuss with us in #riot-dev:matrix.org to find a good approach forward. |
Render and post
m.location
events within riot. Uses Leaflet.Requires riot-web#2774
I went for OSM for the mapping service, but if anyone has any better ideas it should be easy enough to swap over to that. The other issue is that I'm using the upload icon as a placeholder, and using stock Leaflet icons for the map marker. That will probably need to be changed before this can be merged.
Other than that, this should be fairly functional.