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.

AGM is way too slow!

See original GitHub issue

AGM is pretty slow, when you have 500+ Markers. There are pretty much usecases, where this is a normal amount. In my current project, there are many thousands. (Of course, I use the MapClusterer). Some Numbers (similar code as in tutorial):

  • AGM Page loads in 40+ seconds.
  • if I remove the <agm-info-window> (demo content), it’s still more than the half seconds.
  • my old JQuery-Implementation renders same content / data with info-windows and Clusterer within 6.x seconds.

reproduce by modifying plunkr-code something like:

markers: marker[];
  for(i = num;i>=1000;i--) {
   markers.push({
    {
		  lat: 51.673858,
		  lng: 7.815982,
		  label: 'A',
		  draggable: true
	  } 
   });
  }

(maybe fill values with randoms)

My current solution is to “iframe” the content of my old jquery-implementation. Not a beautiful solution, but a fast workaround.

Most answers I found to this issue were like ‘500+ is too much…’ -> troll-postings. Even 5000+ can easily be handled by a simple gmap + jquery implementation.

@agm/core”: “^1.0.0-beta.2”, “@agm/js-marker-clusterer”: “^1.0.0-beta.2”,

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6

github_iconTop GitHub Comments

4reactions
nylzcommented, Apr 21, 2018

Hey, thank you very much, for that hint. Now it is even faster, than my jQuery-implementation. Im pretty new to Angular, so I first had to click through this presentation: https://pascalprecht.github.io/slides/angular-2-change-detection-explained/#/ to understand, what the real problem here was. What I did now: `changeDetection: ChangeDetectionStrategy.OnPush …

constructor(… … private cd: ChangeDetectorRef) { …

onGotResponseFromMyService(resObj: MyResponse) { // enrich component with received data // and … finally: this.cd.detectChanges(); } ` Imho, the name OnPush is a bit confusing. Would be easier to understand if it was labeled ChangeDetectionStrategy.Manually

however. Thank You for support.

1reaction
aarontoyscommented, Apr 18, 2018

@nylz I had the same issue trying to render 1000+ points. I switched to ChangeDetectionStrategy.OnPush and that really helped. See https://github.com/SebastianM/angular-google-maps/issues/520#issuecomment-242485390. I can now render all these points (with clusters and info windows) in about 5 - 6 seconds.

However, I still had the issue when subsequently filtering this list down to 150 or even 20 items [Solved!]. You can see https://github.com/SebastianM/angular-google-maps/issues/1285 for more info. I’ve post my solution and there’s another example there as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

sebholstein/angular-google-maps - AGM is way too slow!
AGM is pretty slow, when you have 500+ Markers. There are pretty much usecases, where this is a normal amount. In my current...
Read more >
Is it better to charge an AGM battery fast or slow? - Quora
As far as I know, slow charging is always better. Your battery will have a longer life. Slow-charging won't heat up the battery...
Read more >
"Safe" (but slower) charge method for AGM batteries?
No, that's not true. If you gas an AGM battery, most of it will recombine as water but the ~1% that doesn't is...
Read more >
AGM Batteries: Ruined upon Slow Discharge? - AirForums
AGM Batteries: Ruined upon Slow Discharge? AGM batteries are just as touchy about deep discharge as a flooded (conventional) lead-acid battery.
Read more >
Don't Kill That New AGM Battery - Practical Sailor
There are many things that can lead to reduced battery capacity in an AGM battery, but most often the cause is due to...
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