ebidel / geo-location

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

Added accuracy property #34

Closed benquan closed 6 years ago

benquan commented 6 years ago

I have a added the accuracy property to be pulled to the project.

benquan commented 6 years ago

Changes ready

FluorescentHallucinogen commented 6 years ago

@ebidel @benquan Do we need a separate property for this, while we can access it via the position object property?

<geo-location
    watch-pos
    high-accuracy
    position="{{position}}">
</geo-location>

<p>Accuracy: [[position.coords.accuracy]]</p>

If yes, I can create a pull request that adds separate properties for all position object properties such as accuracy, altitude, altitude accuracy, heading, speed, timestamp. :wink:

ebidel commented 6 years ago

@FluorescentHallucinogen that's a good point. I exposed lat/long b/c those are the most common but you can get accuracy through position.

I don't think we need properties for all the sub properties :)

FluorescentHallucinogen commented 6 years ago

@ebidel On the other hand, the separate properties are more easy to use. As you can see, not all users know / understand that accuracy, altitude, altitude accuracy, heading, speed, timestamp, etc. are hidden behind the position object.

ebidel commented 6 years ago

Every property does come at a cost (observers, listeners, etc.) I think examples and docs help with showing what's possible.

FluorescentHallucinogen commented 6 years ago

@ebidel Could this pull request be closed?

ebidel commented 6 years ago

Closing since position already gives you this info. Appreciate the PR @benquan!