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
where selectedAddress.coordinates is {latitude: 20, longitude: 20} breaks with an error in Google Maps API because this.latitude and this.longitude in updatePosition are strings, not numbers. It'd be very useful if the assumption that these values are numbers were not there.
This seems to happen because setAttribute converts its second argument to a string, and Polymer's misfeature of guessing the expected type and automatically converting does not work when an attribute is set with setAttribute.
The text was updated successfully, but these errors were encountered:
rightfold
changed the title
google-map-marker does not work when latitude and longitude are provided by Angular.js
google-map-marker does not work when latitude and longitude are provided by AngularJS
Sep 3, 2014
Where selectedAddress.coordinates is {latitude: 20, longitude: 20} breaks
with an error in Google Maps API because this.latitude and this.longitude
in updatePosition https://github.com/GoogleWebComponents/google-map/blob/master/google-map.html#L113
are strings, not numbers. It'd be very useful if the assumption that these
values are numbers were not there.
—
Reply to this email directly or view it on GitHub #49.
They are numbers in my data (selectedAddress.coordinates is {latitude: 20, longitude: 20}), but AngularJS calls setAttribute and setAttribute casts the value to a string.
I'll put in a check, but when I test .setAttribute('latitude', 37.879) or .setAttribute('latitude', '37.879') directly on the map element in the console, there are no errors.
Given the following example:
where
selectedAddress.coordinates
is{latitude: 20, longitude: 20}
breaks with an error in Google Maps API becausethis.latitude
andthis.longitude
inupdatePosition
are strings, not numbers. It'd be very useful if the assumption that these values are numbers were not there.This seems to happen because
setAttribute
converts its second argument to a string, and Polymer's misfeature of guessing the expected type and automatically converting does not work when an attribute is set withsetAttribute
.The text was updated successfully, but these errors were encountered: