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

[core] Get rid of user-specified refs #7586

Merged
merged 3 commits into from
Jan 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ mason_use(pixelmatch VERSION 0.10.0 HEADER_ONLY)
mason_use(geojson VERSION 0.4.0 HEADER_ONLY)
mason_use(polylabel VERSION 1.0.2 HEADER_ONLY)

add_definitions(-DRAPIDJSON_HAS_STDSTRING=1)

if(WITH_COVERAGE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --coverage")
Expand Down
3 changes: 3 additions & 0 deletions cmake/core-files.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ set(MBGL_CORE_FILES
src/mbgl/style/cross_faded_property_evaluator.cpp
src/mbgl/style/cross_faded_property_evaluator.hpp
src/mbgl/style/function.cpp
src/mbgl/style/group_by_layout.cpp
src/mbgl/style/group_by_layout.hpp
src/mbgl/style/layer.cpp
src/mbgl/style/layer_impl.cpp
src/mbgl/style/layer_impl.hpp
Expand Down Expand Up @@ -260,6 +262,7 @@ set(MBGL_CORE_FILES
include/mbgl/style/conversion/property_value.hpp
include/mbgl/style/conversion/source.hpp
include/mbgl/style/conversion/tileset.hpp
src/mbgl/style/conversion/stringify.hpp

# style/layers
include/mbgl/style/layers/background_layer.hpp
Expand Down
2 changes: 2 additions & 0 deletions cmake/test-files.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,12 @@ set(MBGL_TEST_FILES

# style/conversion
test/style/conversion/geojson_options.test.cpp
test/style/conversion/stringify.test.cpp

# style
test/style/filter.test.cpp
test/style/functions.test.cpp
test/style/group_by_layout.test.cpp
test/style/source.test.cpp
test/style/style.test.cpp
test/style/style_layer.test.cpp
Expand Down
4 changes: 2 additions & 2 deletions include/mbgl/style/filter_evaluator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ class FilterEvaluator {
return false;
}

bool operator()(const std::unordered_map<std::string, Value>&,
const std::unordered_map<std::string, Value>&) const {
bool operator()(const PropertyMap&,
const PropertyMap&) const {
// Should be unreachable; nested values are not currently allowed by the style specification.
assert(false);
return false;
Expand Down
2 changes: 2 additions & 0 deletions include/mbgl/style/layer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ class Layer : public mbgl::util::noncopyable {

// Private implementation
const std::unique_ptr<Impl> baseImpl;

friend std::string layoutKey(const Layer&);
};

} // namespace style
Expand Down
1 change: 1 addition & 0 deletions include/mbgl/util/color.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class Color {
static constexpr Color blue() { return { 0.0f, 0.0f, 1.0f, 1.0f }; };

static optional<Color> parse(const std::string&);
std::string stringify() const;
};

constexpr bool operator==(const Color& colorA, const Color& colorB) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"express": "^4.11.1",
"lodash": "^4.16.4",
"mapbox-gl-style-spec": "mapbox/mapbox-gl-style-spec#49e8b407bdbbe6f7c92dbcb56d3d51f425fc2653",
"mapbox-gl-test-suite": "mapbox/mapbox-gl-test-suite#2bdca923fc4190156b5a22af71be29442451db54",
"mapbox-gl-test-suite": "mapbox/mapbox-gl-test-suite#7bf5725a2dfe848463db85ff2c85a0f9551d18bf",
"mkdirp": "^0.5.1",
"node-cmake": "^1.2.1",
"pixelmatch": "^4.0.2",
Expand Down
2 changes: 1 addition & 1 deletion platform/node/src/node_conversion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ inline v8::Local<v8::Value> arrayMember(v8::Local<v8::Value> value, std::size_t

inline bool isObject(v8::Local<v8::Value> value) {
Nan::HandleScope scope;
return value->IsObject();
return value->IsObject() && !value->IsArray();
}

inline optional<v8::Local<v8::Value>> objectMember(v8::Local<v8::Value> value, const char * name) {
Expand Down
4 changes: 2 additions & 2 deletions src/mbgl/annotation/style_sourced_annotation_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ void StyleSourcedAnnotationImpl::updateStyle(Style& style) const {
return;

if (sourceLayer->is<LineLayer>()) {
std::unique_ptr<Layer> layer = sourceLayer->baseImpl->copy(layerID, "", AnnotationManager::SourceID);
std::unique_ptr<Layer> layer = sourceLayer->baseImpl->copy(layerID, AnnotationManager::SourceID);
layer->as<LineLayer>()->setSourceLayer(layerID);
layer->as<LineLayer>()->setVisibility(VisibilityType::Visible);
style.addLayer(std::move(layer), sourceLayer->getID());
} else if (sourceLayer->is<FillLayer>()) {
std::unique_ptr<Layer> layer = sourceLayer->baseImpl->copy(layerID, "", AnnotationManager::SourceID);
std::unique_ptr<Layer> layer = sourceLayer->baseImpl->copy(layerID, AnnotationManager::SourceID);
layer->as<FillLayer>()->setSourceLayer(layerID);
layer->as<FillLayer>()->setVisibility(VisibilityType::Visible);
style.addLayer(std::move(layer), sourceLayer->getID());
Expand Down
7 changes: 4 additions & 3 deletions src/mbgl/layout/symbol_layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <mbgl/layout/clip_lines.hpp>
#include <mbgl/renderer/symbol_bucket.hpp>
#include <mbgl/style/filter_evaluator.hpp>
#include <mbgl/style/layer.hpp>
#include <mbgl/sprite/sprite_atlas.hpp>
#include <mbgl/text/glyph_atlas.hpp>
#include <mbgl/text/get_anchors.hpp>
Expand All @@ -26,7 +27,7 @@ namespace mbgl {

using namespace style;

SymbolLayout::SymbolLayout(std::string bucketName_,
SymbolLayout::SymbolLayout(std::vector<std::unique_ptr<Layer>> layers_,
std::string sourceLayerName_,
uint32_t overscaling_,
float zoom_,
Expand All @@ -36,7 +37,7 @@ SymbolLayout::SymbolLayout(std::string bucketName_,
style::SymbolLayoutProperties::Evaluated layout_,
float textMaxSize_,
SpriteAtlas& spriteAtlas_)
: bucketName(std::move(bucketName_)),
: layers(std::move(layers_)),
sourceLayerName(std::move(sourceLayerName_)),
overscaling(overscaling_),
zoom(zoom_),
Expand Down Expand Up @@ -253,7 +254,7 @@ void SymbolLayout::addFeature(const SymbolFeature& feature,
? SymbolPlacementType::Point
: layout.get<SymbolPlacement>();
const float textRepeatDistance = symbolSpacing / 2;
IndexedSubfeature indexedFeature = {feature.index, sourceLayerName, bucketName, symbolInstances.size()};
IndexedSubfeature indexedFeature = {feature.index, sourceLayerName, layers.at(0)->getID(), symbolInstances.size()};

auto addSymbolInstance = [&] (const GeometryCoordinates& line, Anchor& anchor) {
// https://github.com/mapbox/vector-tile-spec/tree/master/2.1#41-layers
Expand Down
5 changes: 3 additions & 2 deletions src/mbgl/layout/symbol_layout.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ class SymbolBucket;

namespace style {
class Filter;
class Layer;
} // namespace style

struct Anchor;

class SymbolLayout {
public:
SymbolLayout(std::string bucketName_,
SymbolLayout(std::vector<std::unique_ptr<style::Layer>>,
std::string sourceLayerName_,
uint32_t overscaling,
float zoom,
Expand Down Expand Up @@ -55,7 +56,7 @@ class SymbolLayout {

State state = Pending;

const std::string bucketName;
const std::vector<std::unique_ptr<style::Layer>> layers;
const std::string sourceLayerName;

private:
Expand Down
Loading