iidioter / earth-api-samples

Automatically exported from code.google.com/p/earth-api-samples
0 stars 0 forks source link

Icon heading displayed incorrectly. #131

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. run the first attached html file, posTgtPt01.htm in a browser and
observe the orientation of the arrow - straight up.
2. Close the session and open the second file, posTgtPt02.htm in the
browser. This is identical to the first but with the heading of the icon
and the LookAt increased by 45 degrees. The Icon is no longer straight up,
but at an angle to the left.

What is the expected output or behavior? 
Expect to see the Icon still straight up as we have changed the heading of
both the Icon and the lookAt by the same amount.

What do you see instead?
The Icon is now angled at around 45 degrees to the left.
I have tested further values - from 0 to 45 the variation increases to the
left, from 45 to 90 it decreases to 0, from 90 to 135, it increases to the
right and from 135 to 180, it decreases back to zero. From 180 to 360 the
pattern is repeated.
This bug was introduced in the version that first exhibited the Icon Name
incorrect orientation that we reported in bug report 113. At the time we
thought we had a bug in our code, but the above test demonstrates otherwise.

Which plugin version are you using?
Current - 4.3.11528.8566

Which browsers and operating systems are affected?
FireFox 3.0.5, IE 6.0.2900

Please provide any additional information (code snippets/links) below.
In previous versions and the current Google Earth, the icon is displayed as
a flat object in a plane that remains perpendicular to the LookAt
irrespective of the lookAt's orientation. In this version of geplugin the
plane of the icon appears to vary depending on the lookAt's orientation. 

Original issue reported on code.google.com by gpsanima...@gmail.com on 27 Dec 2008 at 7:24

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the additional details on this new issue.  You can keep track of the 
status of this at issue #492

Original comment by jli...@google.com on 4 Jan 2011 at 9:14

GoogleCodeExporter commented 9 years ago
Hi, I'm a developer for Google Earth.

Yes this is a known bug and we are working on fixing it.

We also have a workaround/fix that will be forward compatible for you! The 
trick here is that you will need to create your IconStyle using <kml> text.

As gpsanimator correctly notes, there is an undocumented tag that is being 
assigned to the <IconStyle> which will be released in a future client which is 
<gx:headingMode>.  <gx:headingMode>screenUp</gx:headingMode> is assigned by 
default iff the <heading> value is initially 0. If the value is something other 
than 0, <gx:headingMode>northUp</gx:headingMode> is being assigned.

Read that again.

Okay still with me? The reason why we do it this way is to emulate the way that 
earth used to use IconHeading before we had explicit heading modes. 
Unfortunately it also means that as soon as the headingMode is assigned it's 
(semi)permanent as far as the js developer is concerned.

Workaround:

Create your <IconStyle> with <gx:headingMode>northUp</gx:headingMode> as kml 
text and parse it with the appropriate javascript apis (ge.parseKml() I assume).

Original comment by zach.vor...@gmail.com on 6 Jan 2011 at 4:18

GoogleCodeExporter commented 9 years ago
Zach

Thank you for your help.  This fixed the problem for me but created a new one.  
I have not played around much, but it seems that I can not use this method 
"inline" in the placemark while inheriting attributes from a global style.  
Example, I can not make a style, referenced with <styleUrl> then modify just 
the heading inline in the placemark.

Do you know of an easy way around this without having to modify all my styles 
in-line when rotation is desired?  I would love to set color/icon/hotspot 
globally and just mod heading in the placemark <Style> tag.

Brings me to another question.  How far back does this tag work?  I'm using GE 
EC 5.1.3533.1731 and it works.  

Is there any way we can expedite the "documented" nature of this feature so we 
can all use it?  Example, from what I read in your comment, it sounded like to 
make "90" point "East" that I wanted to use northUp, but I'm using screenUp and 
90 points East.

Original comment by mccon...@gmail.com on 27 Jan 2011 at 8:43