v1.23 misalignment of placemark icon and an associated line primitive in KML

Hi,
Thanks for the great v1.23 update. Our application imports a KML file with the position of a small fleet of ships. In addition to the icon (balloon) showing the position there is also a line that shows the projected sailing. All of a sudden, with v1.23 there is a misalignment of the icon and the origin of the line. The origin of the line seems correct, and it is therefore an icon offset bug, I believe.

For at least the past 7 releases of Cesium, there has been a precise alignment of the center of the icon with the origin of the line. It is a pretty convoluted system with dynamic czml import, menus/scripted popups, etc in a jquery-UI and Mobile framework, so there is always tension on compatibility on version upgrades, but everything has routinely worked fine. Until this.

The typical (actual) KML code in quesion is like the following:

Ship name#id-12-c97.6693,5.55017,0

96.1119,6.1737,097.6693,5.550171467354342

Is there anything you need from me to illustrate it?

Kjell

… the culprit in v1.23 seems to be the incorrect setting of the default value for the KML <hotSpot … /> tag. By Google KML docs, the default is icon center, but CesiumJS v1.23 now seems to use “bottom left”.

Kjell

Here is a KMZ file that can show the issue:

http://tropicalatlantic.com/recon/archive/al/2016/Danielle/AF/02/map.kmz

Here is a working version of how version 1.22.1 worked properly with that file:

http://tropicalatlantic.com/recon/recon.cgi?basin=al&year=2016&storm=Danielle&mission=02&agency=AF&mapping=cesium

The icon alignment must be centered in the middle so that when the wind barbs are rotated they rotate around the same point.

Kjell, Christopher,

Thanks for providing the examples! I’m guessing this was introduced when we added support for terrain clamping.

I wrote up an issue here for us to look into it: https://github.com/AnalyticalGraphicsInc/cesium/issues/4082

Best,

Hannah

Yeah, it looks like we introduced the bug in 1.23. I opened a pull request that should fix this issue https://github.com/AnalyticalGraphicsInc/cesium/pull/4090. If you want to give that a try, I think it should fix your issue.

Hi,
I added the changes you posted on github and they seem to fix the main issue. I note the principle discussion it has sparked, but assume it is internal.

The testing revealed another issue, though, which must be quite old. I am unsure if it should be a new issue ticket.

The problem appears with a non-symmetric icon/billboard where the directional alignment is important. In 2-D everything is fine in Cesium now, but in the 3-D globe the icon/billboard is not rotated with the axis of the globe. I have attached two sample pictures showing correct display and incorrect for the same object, when the globe gets rotated. Everything is fine when the longitude line and the object is center screen. The issue becomes extreme at polar latitudes.

I assume it is a simple trig adjustment…

Kjell

As a aside, a KML feature not supported by Cesium currently is to specify a directional icon/billboard showing the bearing (course) of an object (e.g. ship). (See. http://earth.google.com/images/kml-icons/track-directional/track-0.png. They are indexed 0 to 15, each covering 22.5 degrees of the circle, but when a bearing is given in KML the spec provided for the best icon index is automatically substituted…

Correct.png

Incorrect.png

Hi,
Some further testing. Vertical centering seems fixed, however there is a horizontal offset from the start of the line primitive that changes as the element is moves with the globe from one side of the screen to the other. At the center of the screen both x and y are nicely overlapping. Moving the globe westward, the billboard is shifted to the left of the primitive’s origin, conversely moving the globe eastward.

I discovered the billboard.alignedAxis property and changed the relevant billboards from KML from the default align screen to align North (Z). This did not seem to change anything, though. Is there some other setting that I need to activate?

Kjell