Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added geoJSON source getBounds method #5403
base: main
Are you sure you want to change the base?
Added geoJSON source getBounds method #5403
Changes from 41 commits
427b8b8
4447079
424ab5c
4790824
ad8cf0a
15c6d00
e53ead9
7a6e82f
3016268
a9640a4
038fc08
0a161f1
6ce70fb
d8ac930
f805489
ac7afa1
c112544
6c3e0cd
7455aff
91a8193
944c5d9
873b344
a471b2c
2c493a1
3a2e5c7
8c60411
0c49eda
fffd20d
c629dee
059b744
f33c64a
6fd45ca
d2642b7
3cce7b8
bbe2976
cde489c
9b5274c
6db2340
97ed09c
7f41246
47c0856
d323876
99a7b9e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure this is what I would expect as a return value...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO, if the source has no data, its bounding box should be empty
Check warning on line 294 in src/source/geojson_source.ts
src/source/geojson_source.ts#L261-L294
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use
await once(...)
to make less indentation and make sure the test waits from the map to load.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like
await map.once('load');
doesn't work as expected..once()
only works withMapLayerEventType
, andload
is a MapEventType, so... not supported.on()
works withMapEventType
, but the listener is compulsory and returns a Subscription, not a PromiseI need to move back to
map.on('load' =>{...})
(and we might need to change the behavior of
once()
to reflect the one ofon()
)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what you are talking about, the unit tests are filled with
await once('load');
, here's one for example:maplibre-gl-js/src/ui/map_tests/map_basic.test.ts
Line 80 in bedcb86
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just posting the errors the tests gave me (commit 6db23408202feea1a9967c083fb07a06b0a9b8db) in a human-readable way.
I've gone to check that weirdness in the documentation, and those in my message above are the links 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on amd once are different...
Using await on(...) shouldn't work as it's not designed to work this way.
Regarding the tests failures after the once change, the error message indicate that the expected object is "{}" which I find odd, regardless of the test failure. I would advise to try and run this code is a jsbin and see how it works, and after it works as expected, copy it to this file...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getData is using messages to communicate with workers, so it you want to use that, you'll need to mock the workers communication since it's running in node environment and not in the browser.
When running things in the browser I expect it to just work, like it does in the examples we have in the docs, which uses this kind of await once code...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both
bounds
andtestbounds
are being used with their default values becauseawait map.once()
is not working as expected and... just doesn't wait 😅 So the flow reaches the assessment but the code to get the bounds has not runThe problem I found with the tests is that running them locally or even building sample code, behaves differently than within the contexts that Jenkins/GH Actions/Whatever uses. I get different errors, messages, and so on. That's why I'm sending too many commits, to getting actionable information from the online tests that I don't get locally
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not resolved.
Please try and use codespaces if you can't reproduce the issue locally...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any help is welcome, I wasn't able to make the integration tests work using
await map.once()
.In that very same file, the pattern is
map.once('load', callback)
(even whenload
event is not supported, as per the docs, bymap.once
)maplibre-gl-js/test/integration/browser/browser.test.ts
Line 53 in 6c54ed3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the geometry be simplified (2-3 points)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, but I've just reused the data in the unit tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then the data there probably needs simplification as well...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see it... Did you forget to push?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔
It's pushed https://github.com/AbelVM/maplibre-gl-js/blob/main/test/integration/browser/browser.test.ts