This object is in archive! 

Support "on hover" labels in KML import (scale 0)

joeloc shared this idea 7 years ago
Completed

KML has "hovering" placemark labels that only appear when pointer is on top. It would be great if Locus supported that. Maybe it's a rather simple addition, since you already seem to parse styles somewhat and since Locus supports "hovering" for its waypoints already.


The technique used in KML for this is to scale the normal label to 0 using a style map.


<Style id="top0"><LabelStyle><scale>0</scale></LabelStyle></Style>

<Style id="top1"><LabelStyle><scale>1</scale></LabelStyle></Style>

<StyleMap id="top">

<Pair><key>normal</key><styleUrl>#top0</styleUrl></Pair>

<Pair><key>highlight</key><styleUrl>#top1</styleUrl></Pair>

</StyleMap>


A simplified scanner in Locus could for example parse the label styles for a placemark and do something like

if (normal->scale==0 && highlight->scale!=0)

set_waypoint_label_to_hovering();

Replies (6)

photo
1

Attached is a sample kml file for hovering labels. In Google Earth, all photo waypoints (little camera) and all blog entry waypoints (white bubble) show their labels only when the mouse is on top. In Locus, all labels are always visible.

photo
1

f5d3376f69eae7f1805ff96bd8568645

photo
1

Hello, task done. Please just keep in mind, that settings in map - object & styles > content of popup for points > labels on map, has a priority. So if you disable labels here, they won't be visible no matter of it's style.

photo
1

Thanks... looking forward to new beta to play with.


Will this also work for KML used as mapitem? Or only when imported?

photo
1

You are welcome. It should work for both, there is no difference in this case.

photo
1

Another problem related to labels is that KML / GoogleEarth does not show labels for linestrings. People add a <point> in a <multigemoetry> when they want their linestrings to have a label.


Locus does show labels for "linestrings" (which become tracks), at least when its settings tell it to. This mostly results in double labels when showing KML, one from the linestring/track and one from the point.


Maybe tracks imported from KML linestrings should set their label in Locus to OnHover or Never automatically?


In general, I guess KML/KMZ used as mapitem shouldn't depend on Locus settings at all. But this is probably quite hard to do with current implementation.

photo
1

Hmm, what you describe leads to "visible kml won't depend on Locus implementation, but on how Google Earth display it". It's wrong as well.

If you find me in official KML documentation ( https://developers.google.com/kml/documentation/kmlreference#syntax_71 ), that Labels should not apply on LineStrings, I'll do something with it. Otherwise your method with point is just a hack on Google Earth, that is not needed in Locus.

EDIT: as I think about it, labels for tracks in Locus are completely independent on LabelStyle in KML. If you do not want to see them, just disable them.

photo
1

I don't understand...


If I have a placemark with a LineString and a Point in KML, google earth shows ONE label. Locus shows TWO equal labels (with the same name coming from placemark name tag). Isn't that wrong?


If I have a placemark with just a linestring and nothing else, GoogleEarth shows ZERO labels. Locus shows ONE.


Putting the blame on GEarth is kind of besides the point. They define whats right and wrong in KML and how its supposed to render. We might not like the lousy documentation, but Google is king here and every KML on this planet is authored to show in GoogleEarth. Locus can only play catchup and render it as similar as possible.

photo
1

Google Earth has a lot of troubles with rendering mainly an inner texts in Placemarks, but it's another story.


What is your settings in Map - Objects & Styles > Tracks popup content > Labels on map? Set there "Do not show" as this is default option.

photo
1

Thats just plain wrong. KML display should not depend on Locus settings, at least not when it's just a mapitem. Isnt that obvious? Otherwise I can never write a KML that looks similar in Google Earth and in Locus.


Once you import a KML into your tracks & points database, you can mess it up with your settings as much as you like. It does make sense then. But as long as it's only a mapitem, it must not have anything to do with Locus settings.


Again: KML only labels Points, not LineStrings. So if I want a labeled track in GoogleEarth, I will put a LineString and a Point together in a MultiGeometry in a PlaceMark.


Locus will turn this into TWO labels, depending on the users settings. Not good.


Also... Google Earth will NOT mark a LineString with a random start-of-track icon. Thats also a Locus thing which must not be used on a kml mapitem file.

photo
1

6f7a45692ac1982b624c18a7d574c6e9

Why do I care so much about KML? Because I made a kml network link that automatically displays tracks of many major tour portals inside Locus (utagawa, gpsies, etcpp). Inside Locus, these are a hundred times more useful for researching trips than in separate ugly apps or in a browser.

However, Locus insists on adding its labels and icons to my network link kml... which kind of destroys the map. Fixing that by changing Locus Settings is besides the point... because I might actually want to see track labels and icons for all the other tracks in the Locus database.

Replies have been locked on this page!