question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

InvalidValueError when upgrading from beta.3 to beta.5

See original GitHub issue

Issue description Upgrading from 1.0.0-beta.3 to 1.0.0-beta.5 causes the following error in Chrome:

ERROR Error: Uncaught (in promise): InvalidValueError: not a LatLngBounds or LatLngBoundsLiteral: not an Object Error

This only happens on maps that I am using the following function on. Any other maps with a single marker do not cause the error.

this.mapsAPILoader.load().then(() => {
  this.latlngBounds = new window['google'].maps.LatLngBounds();
  for (const point of this.points) {
     this.latlngBounds.extend(new window['google'].maps.LatLng(point['lat'], point['lng']));
  }
});

After diving into it a little more, it is the [fitBounds] input on the agm-map tag that is causing the error. Has the format of how we are supposed to pass the data object into [fitBounds] changed?

<agm-map [latitude]=""
           [longitude]=""
           [zoom]=""
           [fitBounds]="latlngBounds"> <!-- passing it into fitBounds is what is causing the error -->

Steps to reproduce and a minimal demo of the problem

Here is a stackblitz, that shows the error. Changing the agm/core dependency to beta.3 will fix the error. https://stackblitz.com/edit/angular-google-maps-demo-fjugvd?file=app%2Fapp.module.ts

What steps should we try in your demo to see the problem?

  • Fork the repo
  • Run the code and open a console to see the error.
  • In package.json, chagne agm/core to beta.3
  • Save, and make sure the dependencies dropdown is beta.3
  • Run the code and open a console to see no error

Current behavior Error being thrown when upgrading when previous version did not throw the error. Or an explanation of a proper way to upgrade.

Expected/desired behavior No errors should be caused by the upgrade.

angular2 & angular-google-maps version 1.0.0-beta.3 works 1.0.0-beta.4 errors 1.0.0-beta.5 errors

Other information

image

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:5

github_iconTop GitHub Comments

8reactions
chakstudcommented, Jan 2, 2019

with setting the initial value to false worked for me. this.latlngBounds : any = false;

1reaction
arkDcommented, Dec 27, 2018

try this it worked for me: <agm-map [fitBounds]=“true”> <agm-marker [agmFitBounds}=“true” …

Read more comments on GitHub >

github_iconTop Results From Across the Web

InvalidValueError when upgrading from beta.3 to beta.5 #1530
Issue description Upgrading from 1.0.0-beta.3 to 1.0.0-beta.5 causes the following error in Chrome: ERROR Error: Uncaught (in promise): ...
Read more >
setCenter: not a LatLng or LatLngLiteral: in property lat: not a ...
I kept getting this error (same as the OP) when trying to use the autocompleted lat/lng to update a map: var place =...
Read more >
Upgrading Your Maps JavaScript API Application from V2 to V3
To verify, check the the URL from which you load the Maps JavaScript API for its key parameter. If the key value starts...
Read more >
Waypoint problems, does not create a route - Google Groups
I have upgraded the store locator that are used in the code examples at Google. ... var geo = google.gears.factory.create('beta.geolocation');
Read more >
Doctor Documentation - Read the Docs
Doctor Documentation, Release 3.0.0-beta.5. This module uses python types to validate request and response data in Flask Python APIs and generate API docu-....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found