This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Supercluster.hpp 0.3.0 update #12726
Closed
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a1744e5
[core] - bump supercluster dependency to 0.3.0
tobrun 1db31ca
[core] - expose getChildren, getLeaves, getClusterExpansionZoom on Su…
tobrun 39e4de0
Updated supercluster to 0.3.1
a1eb283
[android] - integrate supercluster api 0.3.0
tobrun 78c5a8e
[all] - rename functions to include cluster
tobrun a7c217e
[core] Add unit tests for GeoJSONSource with cluster data
alexshalamov 34c3373
[core] Share GeoJSONData pointer as weak_ptr instead of raw ptr
alexshalamov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,23 +33,23 @@ void RenderGeoJSONSource::update(Immutable<style::Source::Impl> baseImpl_, | |
|
||
enabled = needsRendering; | ||
|
||
GeoJSONData* data_ = impl().getData(); | ||
auto data_ = impl().getData().lock(); | ||
|
||
if (data_ != data) { | ||
if (data.lock() != data_) { | ||
data = data_; | ||
tilePyramid.cache.clear(); | ||
|
||
if (data) { | ||
if (data_) { | ||
const uint8_t maxZ = impl().getZoomRange().max; | ||
for (const auto& pair : tilePyramid.tiles) { | ||
if (pair.first.canonical.z <= maxZ) { | ||
static_cast<GeoJSONTile*>(pair.second.get())->updateData(data->getTile(pair.first.canonical)); | ||
static_cast<GeoJSONTile*>(pair.second.get())->updateData(data_->getTile(pair.first.canonical)); | ||
} | ||
} | ||
} | ||
} | ||
|
||
if (!data) { | ||
if (!data_) { | ||
tilePyramid.tiles.clear(); | ||
tilePyramid.renderTiles.clear(); | ||
return; | ||
|
@@ -63,7 +63,7 @@ void RenderGeoJSONSource::update(Immutable<style::Source::Impl> baseImpl_, | |
util::tileSize, | ||
impl().getZoomRange(), | ||
optional<LatLngBounds>{}, | ||
[&] (const OverscaledTileID& tileID) { | ||
[&, data = data_] (const OverscaledTileID& tileID) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: use |
||
return std::make_unique<GeoJSONTile>(tileID, impl().id, parameters, data->getTile(tileID.canonical)); | ||
}); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
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.
Is it necessary to create the
shared_ptr<>
here for the comparison or can you compare the internal pointers directly?