Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

[core] Reload geojson source on url change - #6770

Merged
ivovandongen merged 1 commit into
masterfrom
6757-geojson-url-mutability
Oct 20, 2016
Merged

ivovandongen merged 1 commit into
masterfrom
6757-geojson-url-mutability

Conversation

@ivovandongen

Copy link
Copy Markdown
Contributor

Fixes #6757

Review @tmpsantos / @brunoabinader ?

@ivovandongen ivovandongen added the Core The cross-platform C++ core, aka mbgl label Oct 20, 2016
@ivovandongen ivovandongen added this to the android-v4.2.0 milestone Oct 20, 2016
@ivovandongen ivovandongen self-assigned this Oct 20, 2016
@mention-bot

Copy link
Copy Markdown

@ivovandongen, thanks for your PR! By analyzing the history of the files in this pull request, we identified @jfirebaugh, @kkaefer and @brunoabinader to be potential reviewers.

@ivovandongen
ivovandongen force-pushed the 6757-geojson-url-mutability branch from a295d1d to 35e6e41 Compare October 20, 2016 12:43

@brunoabinader brunoabinader left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

@ivovandongen
ivovandongen merged commit ab63a94 into master Oct 20, 2016
@ivovandongen
ivovandongen deleted the 6757-geojson-url-mutability branch October 20, 2016 13:18

loaded = true;
observer->onSourceLoaded(base);
req.reset();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the rationale for this change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This enables us to re-request the description when the previous request completed (main use case was: #6751).

Alternatively we could clear the request on setURL.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it should be done in setURL. Resetting here will disable automatic refreshes based on the caching headers, which is necessary to support things like traffic layers.

Comment thread src/mbgl/style/style.cpp
void Style::onSourceDescriptionChanged(Source& source) {
observer->onSourceDescriptionChanged(source);
if (!source.baseImpl->loaded) {
source.baseImpl->loadDescription(fileSource);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix indentation here.

source.baseImpl->setObserver(&test.observer);

//Load initial, so the source state will be loaded=true
source.baseImpl->loadDescription(test.fileSource);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix indentation here.

@ivovandongen

Copy link
Copy Markdown
Contributor Author

@jfirebaugh Made the formatting changes in #6783. Let me know if changes are needed for #6770 (comment) as well.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Core The cross-platform C++ core, aka mbgl

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants