[core] rename query options for query rendered features
This commit is contained in:
committed by
Jesse Bounds
parent
d82092d606
commit
4d325879b8
@@ -182,9 +182,9 @@ public:
|
||||
double getDefaultPitch() const;
|
||||
|
||||
// Feature queries
|
||||
std::vector<Feature> queryRenderedFeatures(const ScreenCoordinate&, const QueryOptions& options = {});
|
||||
std::vector<Feature> queryRenderedFeatures(const ScreenBox&, const QueryOptions& options = {});
|
||||
|
||||
std::vector<Feature> queryRenderedFeatures(const ScreenCoordinate&, const RenderedQueryOptions& options = {});
|
||||
std::vector<Feature> queryRenderedFeatures(const ScreenBox&, const RenderedQueryOptions& options = {});
|
||||
|
||||
AnnotationIDs queryPointAnnotations(const ScreenBox&);
|
||||
|
||||
// Memory
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
namespace mbgl {
|
||||
|
||||
/**
|
||||
* Options for Map queries.
|
||||
* Options for query rendered features.
|
||||
*/
|
||||
class QueryOptions {
|
||||
class RenderedQueryOptions {
|
||||
public:
|
||||
/** layerIDs to include in the query */
|
||||
optional<std::vector<std::string>> layerIDs;
|
||||
|
||||
@@ -882,7 +882,7 @@ void NodeMap::QueryRenderedFeatures(const Nan::FunctionCallbackInfo<v8::Value>&
|
||||
return Nan::ThrowTypeError("First argument must have two components");
|
||||
}
|
||||
|
||||
mbgl::QueryOptions queryOptions;
|
||||
mbgl::RenderedQueryOptions queryOptions;
|
||||
if (!info[1]->IsNull() && !info[1]->IsUndefined()) {
|
||||
if (!info[1]->IsObject()) {
|
||||
return Nan::ThrowTypeError("options argument must be an object");
|
||||
|
||||
@@ -59,7 +59,7 @@ void FeatureIndex::query(
|
||||
const float bearing,
|
||||
const double tileSize,
|
||||
const double scale,
|
||||
const QueryOptions& queryOptions,
|
||||
const RenderedQueryOptions& queryOptions,
|
||||
const GeometryTileData& geometryTileData,
|
||||
const CanonicalTileID& tileID,
|
||||
const style::Style& style,
|
||||
@@ -98,7 +98,7 @@ void FeatureIndex::addFeature(
|
||||
std::unordered_map<std::string, std::vector<Feature>>& result,
|
||||
const IndexedSubfeature& indexedFeature,
|
||||
const GeometryCoordinates& queryGeometry,
|
||||
const QueryOptions& options,
|
||||
const RenderedQueryOptions& options,
|
||||
const GeometryTileData& geometryTileData,
|
||||
const CanonicalTileID& tileID,
|
||||
const style::Style& style,
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
class QueryOptions;
|
||||
class RenderedQueryOptions;
|
||||
|
||||
namespace style {
|
||||
class Style;
|
||||
@@ -41,7 +41,7 @@ public:
|
||||
const float bearing,
|
||||
const double tileSize,
|
||||
const double scale,
|
||||
const QueryOptions& options,
|
||||
const RenderedQueryOptions& options,
|
||||
const GeometryTileData&,
|
||||
const CanonicalTileID&,
|
||||
const style::Style&,
|
||||
@@ -61,7 +61,7 @@ private:
|
||||
std::unordered_map<std::string, std::vector<Feature>>& result,
|
||||
const IndexedSubfeature&,
|
||||
const GeometryCoordinates& queryGeometry,
|
||||
const QueryOptions& options,
|
||||
const RenderedQueryOptions& options,
|
||||
const GeometryTileData&,
|
||||
const CanonicalTileID&,
|
||||
const style::Style&,
|
||||
|
||||
@@ -809,7 +809,7 @@ void Map::removeAnnotation(AnnotationID annotation) {
|
||||
|
||||
#pragma mark - Feature query api
|
||||
|
||||
std::vector<Feature> Map::queryRenderedFeatures(const ScreenCoordinate& point, const QueryOptions& options) {
|
||||
std::vector<Feature> Map::queryRenderedFeatures(const ScreenCoordinate& point, const RenderedQueryOptions& options) {
|
||||
if (!impl->style) return {};
|
||||
|
||||
return impl->style->queryRenderedFeatures(
|
||||
@@ -819,7 +819,7 @@ std::vector<Feature> Map::queryRenderedFeatures(const ScreenCoordinate& point, c
|
||||
);
|
||||
}
|
||||
|
||||
std::vector<Feature> Map::queryRenderedFeatures(const ScreenBox& box, const QueryOptions& options) {
|
||||
std::vector<Feature> Map::queryRenderedFeatures(const ScreenBox& box, const RenderedQueryOptions& options) {
|
||||
if (!impl->style) return {};
|
||||
|
||||
return impl->style->queryRenderedFeatures(
|
||||
@@ -836,7 +836,7 @@ std::vector<Feature> Map::queryRenderedFeatures(const ScreenBox& box, const Quer
|
||||
}
|
||||
|
||||
AnnotationIDs Map::queryPointAnnotations(const ScreenBox& box) {
|
||||
QueryOptions options;
|
||||
RenderedQueryOptions options;
|
||||
options.layerIDs = {{ AnnotationManager::PointLayerID }};
|
||||
auto features = queryRenderedFeatures(box, options);
|
||||
std::set<AnnotationID> set;
|
||||
|
||||
@@ -206,7 +206,7 @@ void Source::Impl::reloadTiles() {
|
||||
|
||||
std::unordered_map<std::string, std::vector<Feature>> Source::Impl::queryRenderedFeatures(const ScreenLineString& geometry,
|
||||
const TransformState& transformState,
|
||||
const QueryOptions& options) const {
|
||||
const RenderedQueryOptions& options) const {
|
||||
std::unordered_map<std::string, std::vector<Feature>> result;
|
||||
if (renderTiles.empty() || geometry.empty()) {
|
||||
return result;
|
||||
|
||||
@@ -24,6 +24,7 @@ class Painter;
|
||||
class FileSource;
|
||||
class TransformState;
|
||||
class RenderTile;
|
||||
class RenderedQueryOptions;
|
||||
|
||||
namespace algorithm {
|
||||
class ClipIDGenerator;
|
||||
@@ -32,7 +33,6 @@ class ClipIDGenerator;
|
||||
namespace style {
|
||||
|
||||
class UpdateParameters;
|
||||
class QueryParameters;
|
||||
class SourceObserver;
|
||||
|
||||
class Source::Impl : public TileObserver, private util::noncopyable {
|
||||
@@ -68,7 +68,7 @@ public:
|
||||
std::unordered_map<std::string, std::vector<Feature>>
|
||||
queryRenderedFeatures(const ScreenLineString& geometry,
|
||||
const TransformState& transformState,
|
||||
const QueryOptions& options) const;
|
||||
const RenderedQueryOptions& options) const;
|
||||
|
||||
void setCacheSize(size_t);
|
||||
void onLowMemory();
|
||||
|
||||
@@ -505,7 +505,7 @@ RenderData Style::getRenderData(MapDebugOptions debugOptions, float angle) const
|
||||
|
||||
std::vector<Feature> Style::queryRenderedFeatures(const ScreenLineString& geometry,
|
||||
const TransformState& transformState,
|
||||
const QueryOptions& options) const {
|
||||
const RenderedQueryOptions& options) const {
|
||||
std::unordered_set<std::string> sourceFilter;
|
||||
|
||||
if (options.layerIDs) {
|
||||
|
||||
@@ -29,7 +29,7 @@ class SpriteAtlas;
|
||||
class LineAtlas;
|
||||
class RenderData;
|
||||
class TransformState;
|
||||
class QueryOptions;
|
||||
class RenderedQueryOptions;
|
||||
|
||||
namespace style {
|
||||
|
||||
@@ -99,8 +99,8 @@ public:
|
||||
|
||||
std::vector<Feature> queryRenderedFeatures(const ScreenLineString& geometry,
|
||||
const TransformState& transformState,
|
||||
const QueryOptions& options) const;
|
||||
|
||||
const RenderedQueryOptions& options) const;
|
||||
|
||||
float getQueryRadius() const;
|
||||
|
||||
void setSourceTileCacheSize(size_t);
|
||||
|
||||
@@ -142,7 +142,7 @@ void GeometryTile::queryRenderedFeatures(
|
||||
std::unordered_map<std::string, std::vector<Feature>>& result,
|
||||
const GeometryCoordinates& queryGeometry,
|
||||
const TransformState& transformState,
|
||||
const QueryOptions& options) {
|
||||
const RenderedQueryOptions& options) {
|
||||
|
||||
if (!featureIndex || !data) return;
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
std::unordered_map<std::string, std::vector<Feature>>& result,
|
||||
const GeometryCoordinates& queryGeometry,
|
||||
const TransformState&,
|
||||
const QueryOptions& options) override;
|
||||
const RenderedQueryOptions& options) override;
|
||||
|
||||
void cancel() override;
|
||||
|
||||
|
||||
@@ -33,6 +33,6 @@ void Tile::queryRenderedFeatures(
|
||||
std::unordered_map<std::string, std::vector<Feature>>&,
|
||||
const GeometryCoordinates&,
|
||||
const TransformState&,
|
||||
const QueryOptions&) {}
|
||||
const RenderedQueryOptions&) {}
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -21,7 +21,7 @@ class DebugBucket;
|
||||
class TransformState;
|
||||
class TileObserver;
|
||||
class PlacementConfig;
|
||||
class QueryOptions;
|
||||
class RenderedQueryOptions;
|
||||
|
||||
namespace style {
|
||||
class Layer;
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
std::unordered_map<std::string, std::vector<Feature>>& result,
|
||||
const GeometryCoordinates& queryGeometry,
|
||||
const TransformState&,
|
||||
const QueryOptions& options);
|
||||
const RenderedQueryOptions& options);
|
||||
|
||||
void setTriedOptional();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user