owncloud-archive / maps

:globe_with_meridians: Maps app for ownCloud
GNU Affero General Public License v3.0
42 stars 20 forks source link

Show profile pictures on map for Contacts display #57

Closed jancborchardt closed 9 years ago

jancborchardt commented 9 years ago

As mentioned in https://github.com/owncloud/maps/pull/53#issuecomment-129912732, it would be cool to show the profile images from Contacts on the map for the contact display.

cc @v1r0x you up for doing that as well? cc @Henni @DJaeger @brantje

v1r0x commented 9 years ago

I should write my master's thesis, but yes, I'm currently trying to fix it ;)

jancborchardt commented 9 years ago

:D:D:D

v1r0x commented 9 years ago

It works for me now, but the URL of the image is hardcoded and I think there should be an easy way to get the profile images. What I did, is looking for the photo field in the contact vcard and extract some metadata information. With that, I can browse to the following URL: https://owncloud.your.tld/index.php/apps/contacts/addressbook/<backend>/<uid>/contact/<cid>/photo This is the URL I use in the script.js. Don't know how add this using the current base64 implementation or as relative URL.

Another cool feature would be to use the auto-generated profile pictures (the ones starting with the first letter of the users name). But again: Don't know how to do it

DJaeger commented 9 years ago

Please make it an option. So users can choose to see images on the map or a simple map marker and see more after click on it (by viewer some data incl. the image in a popup with link to full contact).

DJaeger commented 9 years ago

@v1r0x: How about showing the images the same way as in this cantactlist on the left?

v1r0x commented 9 years ago

What exactly do you mean?

jancborchardt commented 9 years ago

@v1r0x we do the same in the Mail app, where we show the avatars in the message list. The relevant code is at https://github.com/owncloud/mail/blob/master/lib/controller/messagescontroller.php#L142

@DJaeger with ownCloud we prefer to solve things through proper design and decisions rather than offloading that to every single person. People would rather have things work correctly and a software which respects their time rather than be faced with the need to decide things which the software should have solved for them. That’s why we are here. The pins should properly display the contact images, otherwise you have to click every single one of them to find out who it is. There is no disadvantage by showing the avatar instead of a meaningless map marker. (If there are performance issues, we should do lazy loading of the avatars in the background.)

v1r0x commented 9 years ago

I forgot that there is a difference between contacts and users :/ I think the only possible solution is the way I did it or to get the base64 image from the database. What do you think?

jancborchardt commented 9 years ago

@v1r0x did you check how we do it in the Mail app? There we also get it from the Contacts app.

jancborchardt commented 9 years ago

Maybe @DeepDiver1975 or @ChristophWurst can help with how we do this in the Mail app, beyond the code I pasted above.

v1r0x commented 9 years ago

Is there a js api? In the mail app this is done in the controller using php.

jancborchardt commented 9 years ago

@DeepDiver1975 should know more. Maybe @babelouest as well?

v1r0x commented 9 years ago

@jancborchardt what do you think about this PR?

jancborchardt commented 9 years ago

Link for reference: https://github.com/owncloud/maps/pull/58 :)

v1r0x commented 9 years ago

Can we close this, since #58 has been merged?

Henni commented 9 years ago

@v1r0x great fix!

jancborchardt commented 9 years ago

@v1r0x if you add the keyword »fix #57« (with the respective issue number) to a commit in a pull request, or to the body text of a pull request then it will autoclose the issue on merge. :)

v1r0x commented 9 years ago

thanks!

Will do it next time :)