-
-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make it possible to select the text within tooltip popups #142
Comments
This makes sense, but the tooltips are now "regular system tooltips" where it is not possible. To enable this (and links - those are now also not possible) the tooltips must be completely reimplemented. This will for sure not be a trivial work so it falls into the category "maybe some day"... |
Please have a look at the "tooltip" branch which contains custom tooltips that enable copy&paste (using Ctrl+C). The behaviour of items have change - they must now be clicked and there are some other limitations given by "collisions" of click events. The UX has still some glitches, but it is the best I could get to somehow work and enable links and copy&paste. But I'm still not sure if I want to merge it... |
Hmm, using the latest code from tooltip branch I don't see any tooltips at all... |
You must click on the objects now. |
It would be good to have:
|
Added in 694847a. But I really doubt that there are some GPX files with multiple links... |
Thanks!
You won't believe, but I extensively use links in GPX files within my collection of tracks;) For example, I usually add one link to "event's homepage" / "report" / "blog post" / "photoalbum available on the web" / whatever, where I can find all details about the track, and one more link usually to GPSies (RIP) / Wikiloc, where the track is occasionally published. As for me, such approach is very handy, if I want quickly find some info about past events. |
Implemented in master, will be part of 7.16. |
Added in 9905de6. |
@tumic0 One more thing here, I'm looking for a way to get POIs with images (that would be really cool). Currently, it's feasible using geotagged JPG files, but in such case |
I do not like the idea to behave different for a link with a specific MIME type. Moreover, there is only place for one image per info at the moment and there can be multiple links. I could hovever add support for some GPX image extension if there is one as this looks like something useful and would be very easy to implement (the image info is already in every waypoint structure). Or maybe there is some other format that supports waypoint image info (maybe KML, but from what I see its icon tag is connected with a style which is not exactly how I would define the image data is handled in GPXSee). |
I've just found another way: $ export CID=10401
$ export GC_PHOTOS=~/.local/share/gpxsee/POI/GeocachePhotos
$ mkdir -p $GC_PHOTOS
$ wget -O $GC_PHOTOS/$CID.jpg https://geocaching.su/photos/caches/$CID.jpg
$ cat << EOF > ~/.local/share/gpxsee/POI/geocaching.su.gpx
<?xml version="1.0" encoding="UTF-8"?>
<gpx xmlns="http://www.topografix.com/GPX/1/1" version="1.1" creator="">
<wpt lat="61.135466700" lon="29.773033300">
<name>Тропа Хошимина в лесах Карелии</name>
<desc><img width="240" height="240" src="file://$GC_PHOTOS/$CID.jpg"/></desc>
<link href="https://geocaching.su/?pn=101&cid=$CID"></link>
</wpt>
</gpx>
EOF |
Yes, this is maybe the easiest way - use HTML in the description ;-). |
Here is a full example of how to get POI+photos (geocaching.su): #!/usr/bin/env python
import gpxpy
import gpxpy.gpx
from os.path import expanduser
import requests
import shutil
src_url = 'https://nakarte.me/geocachingSu/geocaching_su2.json'
gc_photos = expanduser('~/.local/share/gpxsee/POI/GeocachePhotos')
gpx = gpxpy.gpx.GPX()
for name, cid, lat, lon in requests.get(src_url).json():
if 58 < lat < 62 and 27 < lon < 36:
wpt = gpxpy.gpx.GPXWaypoint(lat, lon, name=name)
wpt.link = 'https://geocaching.su/?pn=101&cid={}'.format(cid)
photo_url = 'https://geocaching.su/photos/caches/{}.jpg'.format(cid)
local_photo_url = 'file://{}/{}.jpg'.format(gc_photos, cid)
with requests.get(photo_url, stream=True) as r:
if r.status_code == requests.codes.ok:
with open('{}/{}.jpg'.format(gc_photos, cid), 'wb') as f:
shutil.copyfileobj(r.raw, f)
wpt.description = '<img width="240" height="240" src="{}"/>'.format(local_photo_url)
gpx.waypoints.append(wpt)
with open('geocaching.su.gpx', 'w') as out:
out.write(gpx.to_xml()) |
For now, it's impossible to select the text (let's say I want to copy coordinates) from tooltip popup:
![screenshot2](https://user-images.githubusercontent.com/688044/43491207-539a37c0-952c-11e8-8f07-9533955c41e9.png)
![screenshot1](https://user-images.githubusercontent.com/688044/43491430-335ed032-952d-11e8-9df9-5aa5aa06e472.png)
I'd like something like that (selecting text from popup in IDE):
The text was updated successfully, but these errors were encountered: