You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Throughout the docs for ember-google-maps, I suggest that people use the hash helper to quickly build up map settings without leaving the template. For example:
<directions.route
@draggable={{true}}
@polylineOptions={{hashstrokeColor="green"strokeWeight=8strokeOpacity=0.7}} as |route|>
The above currently breaks Google Maps when it tries to call hasOwnProperty on the polylineOptions object.
Expected behaviour and feedback
Is this a reasonable use-case for the hash helper? Or should I ditch the idea and remove this pattern from the documentation?
One could argue that creating the object outside of the template is the safer option, given how restrictive the hash helper is around updates. There's nothing stopping a third-party library like Google Maps from calling set in the future and breaking the app.
It's also fair to argue that Google Maps should be using something like Object.prototype.hasOwnProperty.call to be safe.
Any guidance, thoughts, and suggestions are very welcome!
The text was updated successfully, but these errors were encountered:
Note that the hash is an empty object with no prototype chain, therefore common methods like toString are not available in the resulting hash. If you need to use such a method, you can use the call or apply approach:
I guess the solution here is to introduce a custom hash helper.
Description
The object created by the
hash
helper does not inherit fromObject.prototype
and is missing a lot of common functions likehasOwnProperty
.I've been a bit out of the loop, but it seems the behaviour may have changed in: 52f5257
Reproduce
The issue can be reproduced in the production docs for ember-google-maps: https://ember-google-maps.sandydoo.me/docs/directions
Throughout the docs for ember-google-maps, I suggest that people use the
hash
helper to quickly build up map settings without leaving the template. For example:The above currently breaks Google Maps when it tries to call
hasOwnProperty
on thepolylineOptions
object.Expected behaviour and feedback
Is this a reasonable use-case for the
hash
helper? Or should I ditch the idea and remove this pattern from the documentation?One could argue that creating the object outside of the template is the safer option, given how restrictive the hash helper is around updates. There's nothing stopping a third-party library like Google Maps from calling
set
in the future and breaking the app.It's also fair to argue that Google Maps should be using something like
Object.prototype.hasOwnProperty.call
to be safe.Any guidance, thoughts, and suggestions are very welcome!
The text was updated successfully, but these errors were encountered: