ebidel / geo-location

Web component element for the Geolocation API
https://webcomponents.org/element/ebidel/geo-location
86 stars 25 forks source link

Add cool demo for heading property #35

Closed FluorescentHallucinogen closed 6 years ago

FluorescentHallucinogen commented 6 years ago

screenshot

FluorescentHallucinogen commented 6 years ago

@ebidel PTAL. :wink:

ebidel commented 6 years ago

Nice. LGTM.

FluorescentHallucinogen commented 6 years ago

@ebidel Could you please release the new version 2.0.2 for these changes to take effect on https://webcomponents.org?

ebidel commented 6 years ago

Done

FluorescentHallucinogen commented 6 years ago

@ebidel Just noticed that when I open the demo, the following error occurs in the browser console:

_stampTemplate @ template-stamp.html:425 Error: <polygon> attribute transform: Expected number, "rotate()".

Seems this is because of updating the heading value in transform$="rotate([[heading]])" via data binding:

<svg viewBox="-4.5625 -4.5625 9.125 9.125" width="100" height="100">
  <polygon
      points="0,-4.5625 3,3.4375 0,1.4375 -3,3.4375"
      fill="#db4437"
      transform$="rotate([[heading]])">
  </polygon>
</svg>

The heading value can be undefined/null during the web component initialization. Moreover, according to the W3C Geolocation API spec, if the implementation cannot provide heading information, the value of this attribute must be null. If the hosting device is stationary (i.e. the value of the speed attribute is 0), then the value of the heading attribute must be NaN.

I believed that setting the default value of heading property to 0, should solve this problem.

This is not good. How to fix it?

ebidel commented 6 years ago

The compass should point North until there's a value.

On Sun, Mar 4, 2018, 1:30 AM Alexey Rodionov notifications@github.com wrote:

@ebidel https://github.com/ebidel Just noticed that when I open the demo, the following error occurs in the browser console:

_stampTemplate @ template-stamp.html:425 Error: attribute transform: Expected number, "rotate()".

Seems this is because of updating the heading value in transform$="rotate([[heading]])" via data binding:

The heading value can be undefined/null during the web component initialization. Moreover, according to the W3C Geolocation API spec, if the implementation cannot provide heading information, the value of this attribute must be null. If the hosting device is stationary (i.e. the value of the speed attribute is 0), then the value of the heading attribute must be NaN.

I believed that setting the default value of heading property to 0, should solve this problem.

This is not good. How to fix it?

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/ebidel/geo-location/pull/35#issuecomment-370214617, or mute the thread https://github.com/notifications/unsubscribe-auth/AAOigNcrhRi8DOEPUgrH33EmfSJ5Flpwks5ta7QxgaJpZM4SS2-x .

FluorescentHallucinogen commented 6 years ago

@ebidel

The compass should point North until there's a value.

It do! :)

Seems, you didn't understand what I meant in my previous comment. Please open https://raw-dot-custom-elements.appspot.com/ebidel/geo-location/2.0.2/geo-location/demo/index.html page and check errors in the browser console.

FluorescentHallucinogen commented 6 years ago

@ebidel Ping.