feat(core): auto fitBounds#1389
Conversation
|
He is back ! |
4450a48 to
4179f9a
Compare
|
Hi, im using AGM and i wonder if you can tell me how can i add this changes to the last version that i have installed 1.0.0-beta.2 |
| this.bounds$ = from(loader.load()).pipe( | ||
| flatMap(() => this._includeInBounds$), | ||
| skipWhile(() => this._emitPaused), | ||
| // debounce(() => this._boundsChangeDebounceTime$), |
There was a problem hiding this comment.
_boundsChangeDebounceTime$ is not needed, right?
|
Really wanting to use this feature! |
|
+1 |
|
how to use this? |
|
@appsetor not available yet. To work with bounds go look at #719 when assigning "fitBounds" to the "agm-map" directive you need to pass it a value of type LatLngBounds. You can see the docs right here... https://angular-maps.com/api-docs/agm-core/components/AgmMap.html#fitBounds to create such value do what @tscislo did in #719. His answer is a little dated, so my code looks like this...
I make a call to get a list of objects, then for each I add to latlngBounds and on my template I have this
|
a6efee2 to
6770c9f
Compare
6770c9f to
ecd9d5f
Compare
|
this is by far the best answer i have seen @ed-jimmy, I was really struggling with this because of old examples. Thanks You! |
Codecov Report
@@ Coverage Diff @@
## master #1389 +/- ##
==========================================
+ Coverage 28.36% 28.95% +0.59%
==========================================
Files 30 32 +2
Lines 1361 1454 +93
Branches 185 197 +12
==========================================
+ Hits 386 421 +35
- Misses 973 1031 +58
Partials 2 2
Continue to review full report at Codecov.
|
|
@arkD I'm glad I could help! It looks like the commits @SebastianM made were a success. So let's wait and see when the changes are applied and we can use the new method, which is a lot better! |
|
@ed-jimmy tests and docs are WIP right now. After that, it's ready |
|
When will this be merged ? Fantastic improvment. Thanks |
|
Any plans to release this? Because we want to use it. |
|
and how use the function |
New API in favour of #868:
turn on auto fitbounds:
add the
agmFitBoundsdirective to all elements you want to include in the bounds: