Questions

error:InvalidValueError: setCenter: not a LatLng or LatLngLiteral with finite coordinates

Spread the love

It may occur for multiple condition I have got this issue from below condition.

I face this issue in case mapsAPILoader autocomplete service of agm core map library is not call or subscribe. It occur in my business logic when I set latitude and longitude value for agm marker from api on the page and that was blank value. It’s occur when user didn’t select any map position first time and submit form that time I was send blank value of latitude and longitude. When user come again to that page, that time get blank latitude and longitude value that is why I was getting this issue “setCenter: not a LatLng or LatLngLiteral with finite coordinates”.

It may be occur for set string value for latitude and longitude for that you have to check the type of latitude and longitude is number or not otherwise convert it into number. follow below code.

 this.lat = parseFloat(location.lat)
this.lng = parseFloat(location.lng)

I think “setCenter: not a LatLng or LatLngLiteral with finite coordinates” this issue will solve if you face otherwise comment below if you have any issue and doubt related this issue.

angular google map (agm) search location autocomplete and other tutorial list

References

Thank you! please don’t forget to like our Facebook page to get more interesting updates.


Spread the love

About Chandra

Technology lover. Professionally Software Developer and write some Technical Blog to help newcomer.
View all posts by Chandra →

Leave a Reply

Your email address will not be published. Required fields are marked *