Fix style code generation, remove package.json ios (#847)

This commit is contained in:
Bart Louwers
2023-03-03 20:34:40 +01:00
committed by GitHub
parent fb1572bcfb
commit 5b55f1527d
35 changed files with 97 additions and 7256 deletions

View File

@@ -5,24 +5,6 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 3
versioning-strategy: increase
- package-ecosystem: "npm"
directory: "/platform/android"
schedule:
interval: "weekly"
open-pull-requests-limit: 3
versioning-strategy: increase
- package-ecosystem: "npm"
directory: "/platform/ios"
schedule:
interval: "weekly"
open-pull-requests-limit: 3
versioning-strategy: increase
- package-ecosystem: 'github-actions'
directory: '/'
schedule:

View File

@@ -40,7 +40,6 @@ public:
TransitionOptions getBackgroundPatternTransition() const;
// Private implementation
/// @cond FALSE
class Impl;
const Impl& impl() const;

View File

@@ -94,7 +94,6 @@ public:
TransitionOptions getCircleTranslateAnchorTransition() const;
// Private implementation
/// @cond FALSE
class Impl;
const Impl& impl() const;

View File

@@ -70,7 +70,6 @@ public:
TransitionOptions getFillExtrusionVerticalGradientTransition() const;
// Private implementation
/// @cond FALSE
class Impl;
const Impl& impl() const;

View File

@@ -70,7 +70,6 @@ public:
TransitionOptions getFillTranslateAnchorTransition() const;
// Private implementation
/// @cond FALSE
class Impl;
const Impl& impl() const;

View File

@@ -53,7 +53,6 @@ public:
TransitionOptions getHeatmapWeightTransition() const;
// Private implementation
/// @cond FALSE
class Impl;
const Impl& impl() const;

View File

@@ -58,7 +58,6 @@ public:
TransitionOptions getHillshadeShadowColorTransition() const;
// Private implementation
/// @cond FALSE
class Impl;
const Impl& impl() const;

View File

@@ -113,7 +113,6 @@ public:
TransitionOptions getLineWidthTransition() const;
// Private implementation
/// @cond FALSE
class Impl;
const Impl& impl() const;

View File

@@ -97,7 +97,6 @@ public:
TransitionOptions getTopImageSizeTransition() const;
// Private implementation
/// @cond FALSE
class Impl;
const Impl& impl() const;

View File

@@ -70,7 +70,6 @@ public:
TransitionOptions getRasterSaturationTransition() const;
// Private implementation
/// @cond FALSE
class Impl;
const Impl& impl() const;

View File

@@ -275,7 +275,6 @@ public:
TransitionOptions getTextTranslateAnchorTransition() const;
// Private implementation
/// @cond FALSE
class Impl;
const Impl& impl() const;

View File

@@ -8,7 +8,7 @@ export CI ?= 0
# Getting rid of the duplicate package.json file is an open issue
# https://github.com/maplibre/maplibre-gl-native/issues/657
export NODE_PATH = ./node_modules
export NODE_PATH = ../../node_modules
CMAKE ?= cmake
@@ -156,7 +156,7 @@ ios: $(IOS_PROJ_PATH)
# make iproj
.PHONY: iproj
iproj: $(IOS_PROJ_PATH)
iproj: $(IOS_PROJ_PATH) style-code
@# Check if Xcode should run in headless mode
@# If CI=1, then just perform `make iproj`
@# else, use `xed` to open the XCworkspace
@@ -331,7 +331,6 @@ endif
.PHONY: style-code
style-code:
node ../../scripts/generate-style-code.js
# node ../../scripts/generate-shaders.js
.PHONY: codestyle
codestyle:

File diff suppressed because it is too large Load Diff

View File

@@ -1,67 +0,0 @@
{
"name": "@mapbox/mapbox-gl-native",
"version": "5.0.0",
"description": "Renders map tiles with Mapbox GL",
"keywords": [
"mapbox",
"gl"
],
"main": "platform/node/index.js",
"repository": {
"type": "git",
"url": "git://github.com/mapbox/mapbox-gl-native.git"
},
"license": "BSD-2-Clause",
"dependencies": {
"@mapbox/cmake-node-module": "^1.2.0",
"@mapbox/node-pre-gyp": "^1.0.10",
"minimatch": "^5.1.0",
"npm-run-all": "^4.0.2"
},
"devDependencies": {
"@mapbox/flow-remove-types": "^1.3.0-await.upstream.2",
"@mapbox/mvt-fixtures": "3.10.0",
"@octokit/plugin-retry": "^3.0.9",
"@octokit/rest": "^19.0.4",
"aws-sdk": "^2.1213.0",
"csscolorparser": "~1.0.2",
"d3-queue": "3.0.7",
"diff": "4.0.1",
"ejs": "^3.1.7",
"esm": "~3.2.25",
"express": "^4.11.1",
"json-stringify-pretty-compact": "^2.0.0",
"jsonwebtoken": "^9.0.0",
"lodash": "^4.16.4",
"lodash.template": "4.5.0",
"mapbox-gl-styles": "2.0.2",
"pixelmatch": "^5.3.0",
"pngjs": "^6.0.0",
"pretty-bytes": "^5.1.0",
"request": "^2.88.0",
"semver": "^7.3.7",
"shuffle-seed": "1.1.6",
"st": "1.2.2",
"tape": "^4.5.1",
"xcode": "^3.0.1"
},
"engines": {
"node": ">=6"
},
"scripts": {
"install": "node-pre-gyp install --fallback-to-build=false",
"test": "tape platform/node/test/js/**/*.test.js",
"test-memory": "node --expose-gc platform/node/test/memory.test.js",
"test-expressions": "node -r esm platform/node/test/expression.test.js",
"test-render": "node -r esm platform/node/test/render.test.js",
"test-query": "node -r esm platform/node/test/query.test.js"
},
"gypfile": true,
"binary": {
"module_name": "mbgl",
"module_path": "./lib/{node_abi}",
"host": "https://mapbox-node-binary.s3.amazonaws.com",
"remote_path": "./{name}/v{version}",
"package_name": "{node_abi}-{platform}-{arch}-{configuration}.tar.gz"
}
}

View File

@@ -149,6 +149,14 @@ global.propertyValueType = function (property) {
}
};
function formatNumber(property, num = 0) {
if (evaluatedType(property) === "float") {
const str = num.toString();
return str + (str.includes(".") ? "" : ".") + "f";
}
return num.toString();
}
global.defaultValue = function (property) {
// https://github.com/mapbox/mapbox-gl-native/issues/5258
if (property.name === 'line-round-limit') {
@@ -165,11 +173,7 @@ global.defaultValue = function (property) {
switch (property.type) {
case 'number':
if (property.default === undefined) {
return 0;
} else {
return property.default;
}
return formatNumber(property, property.default);
case 'formatted':
case 'string':
case 'resolvedImage':

View File

@@ -93,7 +93,7 @@ TransitionOptions BackgroundLayer::getBackgroundColorTransition() const {
}
PropertyValue<float> BackgroundLayer::getDefaultBackgroundOpacity() {
return {1};
return {1.f};
}
const PropertyValue<float>& BackgroundLayer::getBackgroundOpacity() const {

View File

@@ -21,7 +21,7 @@ struct BackgroundColor : PaintProperty<Color> {
};
struct BackgroundOpacity : PaintProperty<float> {
static float defaultValue() { return 1; }
static float defaultValue() { return 1.f; }
};
struct BackgroundPattern : CrossFadedPaintProperty<expression::Image> {

View File

@@ -82,7 +82,7 @@ void CircleLayer::setCircleSortKey(const PropertyValue<float>& value) {
// Paint properties
PropertyValue<float> CircleLayer::getDefaultCircleBlur() {
return {0};
return {0.f};
}
const PropertyValue<float>& CircleLayer::getCircleBlur() const {
@@ -136,7 +136,7 @@ TransitionOptions CircleLayer::getCircleColorTransition() const {
}
PropertyValue<float> CircleLayer::getDefaultCircleOpacity() {
return {1};
return {1.f};
}
const PropertyValue<float>& CircleLayer::getCircleOpacity() const {
@@ -217,7 +217,7 @@ TransitionOptions CircleLayer::getCirclePitchScaleTransition() const {
}
PropertyValue<float> CircleLayer::getDefaultCircleRadius() {
return {5};
return {5.f};
}
const PropertyValue<float>& CircleLayer::getCircleRadius() const {
@@ -271,7 +271,7 @@ TransitionOptions CircleLayer::getCircleStrokeColorTransition() const {
}
PropertyValue<float> CircleLayer::getDefaultCircleStrokeOpacity() {
return {1};
return {1.f};
}
const PropertyValue<float>& CircleLayer::getCircleStrokeOpacity() const {
@@ -298,7 +298,7 @@ TransitionOptions CircleLayer::getCircleStrokeOpacityTransition() const {
}
PropertyValue<float> CircleLayer::getDefaultCircleStrokeWidth() {
return {0};
return {0.f};
}
const PropertyValue<float>& CircleLayer::getCircleStrokeWidth() const {
@@ -325,7 +325,7 @@ TransitionOptions CircleLayer::getCircleStrokeWidthTransition() const {
}
PropertyValue<std::array<float, 2>> CircleLayer::getDefaultCircleTranslate() {
return {{{0, 0}}};
return {{{0.f, 0.f}}};
}
const PropertyValue<std::array<float, 2>>& CircleLayer::getCircleTranslate() const {

View File

@@ -18,11 +18,11 @@ namespace style {
struct CircleSortKey : DataDrivenLayoutProperty<float> {
static constexpr const char *name() { return "circle-sort-key"; }
static float defaultValue() { return 0; }
static float defaultValue() { return 0.f; }
};
struct CircleBlur : DataDrivenPaintProperty<float, attributes::blur, uniforms::blur> {
static float defaultValue() { return 0; }
static float defaultValue() { return 0.f; }
};
struct CircleColor : DataDrivenPaintProperty<Color, attributes::color, uniforms::color> {
@@ -30,7 +30,7 @@ struct CircleColor : DataDrivenPaintProperty<Color, attributes::color, uniforms:
};
struct CircleOpacity : DataDrivenPaintProperty<float, attributes::opacity, uniforms::opacity> {
static float defaultValue() { return 1; }
static float defaultValue() { return 1.f; }
};
struct CirclePitchAlignment : PaintProperty<AlignmentType> {
@@ -42,7 +42,7 @@ struct CirclePitchScale : PaintProperty<CirclePitchScaleType> {
};
struct CircleRadius : DataDrivenPaintProperty<float, attributes::radius, uniforms::radius> {
static float defaultValue() { return 5; }
static float defaultValue() { return 5.f; }
};
struct CircleStrokeColor : DataDrivenPaintProperty<Color, attributes::stroke_color, uniforms::stroke_color> {
@@ -50,15 +50,15 @@ struct CircleStrokeColor : DataDrivenPaintProperty<Color, attributes::stroke_col
};
struct CircleStrokeOpacity : DataDrivenPaintProperty<float, attributes::stroke_opacity, uniforms::stroke_opacity> {
static float defaultValue() { return 1; }
static float defaultValue() { return 1.f; }
};
struct CircleStrokeWidth : DataDrivenPaintProperty<float, attributes::stroke_width, uniforms::stroke_width> {
static float defaultValue() { return 0; }
static float defaultValue() { return 0.f; }
};
struct CircleTranslate : PaintProperty<std::array<float, 2>> {
static std::array<float, 2> defaultValue() { return {{0, 0}}; }
static std::array<float, 2> defaultValue() { return {{0.f, 0.f}}; }
};
struct CircleTranslateAnchor : PaintProperty<TranslateAnchorType> {

View File

@@ -66,7 +66,7 @@ void FillExtrusionLayer::Impl::stringifyLayout(rapidjson::Writer<rapidjson::Stri
// Paint properties
PropertyValue<float> FillExtrusionLayer::getDefaultFillExtrusionBase() {
return {0};
return {0.f};
}
const PropertyValue<float>& FillExtrusionLayer::getFillExtrusionBase() const {
@@ -120,7 +120,7 @@ TransitionOptions FillExtrusionLayer::getFillExtrusionColorTransition() const {
}
PropertyValue<float> FillExtrusionLayer::getDefaultFillExtrusionHeight() {
return {0};
return {0.f};
}
const PropertyValue<float>& FillExtrusionLayer::getFillExtrusionHeight() const {
@@ -147,7 +147,7 @@ TransitionOptions FillExtrusionLayer::getFillExtrusionHeightTransition() const {
}
PropertyValue<float> FillExtrusionLayer::getDefaultFillExtrusionOpacity() {
return {1};
return {1.f};
}
const PropertyValue<float>& FillExtrusionLayer::getFillExtrusionOpacity() const {
@@ -201,7 +201,7 @@ TransitionOptions FillExtrusionLayer::getFillExtrusionPatternTransition() const
}
PropertyValue<std::array<float, 2>> FillExtrusionLayer::getDefaultFillExtrusionTranslate() {
return {{{0, 0}}};
return {{{0.f, 0.f}}};
}
const PropertyValue<std::array<float, 2>>& FillExtrusionLayer::getFillExtrusionTranslate() const {

View File

@@ -17,7 +17,7 @@ namespace mbgl {
namespace style {
struct FillExtrusionBase : DataDrivenPaintProperty<float, attributes::base, uniforms::base> {
static float defaultValue() { return 0; }
static float defaultValue() { return 0.f; }
};
struct FillExtrusionColor : DataDrivenPaintProperty<Color, attributes::color, uniforms::color> {
@@ -25,11 +25,11 @@ struct FillExtrusionColor : DataDrivenPaintProperty<Color, attributes::color, un
};
struct FillExtrusionHeight : DataDrivenPaintProperty<float, attributes::height, uniforms::height> {
static float defaultValue() { return 0; }
static float defaultValue() { return 0.f; }
};
struct FillExtrusionOpacity : PaintProperty<float> {
static float defaultValue() { return 1; }
static float defaultValue() { return 1.f; }
};
struct FillExtrusionPattern : CrossFadedDataDrivenPaintProperty<expression::Image, attributes::pattern_to, uniforms::pattern_to, attributes::pattern_from, uniforms::pattern_from> {
@@ -37,7 +37,7 @@ struct FillExtrusionPattern : CrossFadedDataDrivenPaintProperty<expression::Imag
};
struct FillExtrusionTranslate : PaintProperty<std::array<float, 2>> {
static std::array<float, 2> defaultValue() { return {{0, 0}}; }
static std::array<float, 2> defaultValue() { return {{0.f, 0.f}}; }
};
struct FillExtrusionTranslateAnchor : PaintProperty<TranslateAnchorType> {

View File

@@ -136,7 +136,7 @@ TransitionOptions FillLayer::getFillColorTransition() const {
}
PropertyValue<float> FillLayer::getDefaultFillOpacity() {
return {1};
return {1.f};
}
const PropertyValue<float>& FillLayer::getFillOpacity() const {
@@ -217,7 +217,7 @@ TransitionOptions FillLayer::getFillPatternTransition() const {
}
PropertyValue<std::array<float, 2>> FillLayer::getDefaultFillTranslate() {
return {{{0, 0}}};
return {{{0.f, 0.f}}};
}
const PropertyValue<std::array<float, 2>>& FillLayer::getFillTranslate() const {

View File

@@ -18,7 +18,7 @@ namespace style {
struct FillSortKey : DataDrivenLayoutProperty<float> {
static constexpr const char *name() { return "fill-sort-key"; }
static float defaultValue() { return 0; }
static float defaultValue() { return 0.f; }
};
struct FillAntialias : PaintProperty<bool> {
@@ -30,7 +30,7 @@ struct FillColor : DataDrivenPaintProperty<Color, attributes::color, uniforms::c
};
struct FillOpacity : DataDrivenPaintProperty<float, attributes::opacity, uniforms::opacity> {
static float defaultValue() { return 1; }
static float defaultValue() { return 1.f; }
};
struct FillOutlineColor : DataDrivenPaintProperty<Color, attributes::outline_color, uniforms::outline_color> {
@@ -42,7 +42,7 @@ struct FillPattern : CrossFadedDataDrivenPaintProperty<expression::Image, attrib
};
struct FillTranslate : PaintProperty<std::array<float, 2>> {
static std::array<float, 2> defaultValue() { return {{0, 0}}; }
static std::array<float, 2> defaultValue() { return {{0.f, 0.f}}; }
};
struct FillTranslateAnchor : PaintProperty<TranslateAnchorType> {

View File

@@ -95,7 +95,7 @@ TransitionOptions HeatmapLayer::getHeatmapColorTransition() const {
}
PropertyValue<float> HeatmapLayer::getDefaultHeatmapIntensity() {
return {1};
return {1.f};
}
const PropertyValue<float>& HeatmapLayer::getHeatmapIntensity() const {
@@ -122,7 +122,7 @@ TransitionOptions HeatmapLayer::getHeatmapIntensityTransition() const {
}
PropertyValue<float> HeatmapLayer::getDefaultHeatmapOpacity() {
return {1};
return {1.f};
}
const PropertyValue<float>& HeatmapLayer::getHeatmapOpacity() const {
@@ -149,7 +149,7 @@ TransitionOptions HeatmapLayer::getHeatmapOpacityTransition() const {
}
PropertyValue<float> HeatmapLayer::getDefaultHeatmapRadius() {
return {30};
return {30.f};
}
const PropertyValue<float>& HeatmapLayer::getHeatmapRadius() const {
@@ -176,7 +176,7 @@ TransitionOptions HeatmapLayer::getHeatmapRadiusTransition() const {
}
PropertyValue<float> HeatmapLayer::getDefaultHeatmapWeight() {
return {1};
return {1.f};
}
const PropertyValue<float>& HeatmapLayer::getHeatmapWeight() const {

View File

@@ -20,19 +20,19 @@ struct HeatmapColor : ColorRampProperty {
};
struct HeatmapIntensity : PaintProperty<float> {
static float defaultValue() { return 1; }
static float defaultValue() { return 1.f; }
};
struct HeatmapOpacity : PaintProperty<float> {
static float defaultValue() { return 1; }
static float defaultValue() { return 1.f; }
};
struct HeatmapRadius : DataDrivenPaintProperty<float, attributes::radius, uniforms::radius> {
static float defaultValue() { return 30; }
static float defaultValue() { return 30.f; }
};
struct HeatmapWeight : DataDrivenPaintProperty<float, attributes::weight, uniforms::weight> {
static float defaultValue() { return 1; }
static float defaultValue() { return 1.f; }
};
class HeatmapPaintProperties : public Properties<

View File

@@ -93,7 +93,7 @@ TransitionOptions HillshadeLayer::getHillshadeAccentColorTransition() const {
}
PropertyValue<float> HillshadeLayer::getDefaultHillshadeExaggeration() {
return {0.5};
return {0.5f};
}
const PropertyValue<float>& HillshadeLayer::getHillshadeExaggeration() const {
@@ -174,7 +174,7 @@ TransitionOptions HillshadeLayer::getHillshadeIlluminationAnchorTransition() con
}
PropertyValue<float> HillshadeLayer::getDefaultHillshadeIlluminationDirection() {
return {335};
return {335.f};
}
const PropertyValue<float>& HillshadeLayer::getHillshadeIlluminationDirection() const {

View File

@@ -21,7 +21,7 @@ struct HillshadeAccentColor : PaintProperty<Color> {
};
struct HillshadeExaggeration : PaintProperty<float> {
static float defaultValue() { return 0.5; }
static float defaultValue() { return 0.5f; }
};
struct HillshadeHighlightColor : PaintProperty<Color> {
@@ -33,7 +33,7 @@ struct HillshadeIlluminationAnchor : PaintProperty<HillshadeIlluminationAnchorTy
};
struct HillshadeIlluminationDirection : PaintProperty<float> {
static float defaultValue() { return 335; }
static float defaultValue() { return 335.f; }
};
struct HillshadeShadowColor : PaintProperty<Color> {

View File

@@ -142,7 +142,7 @@ void LineLayer::setLineSortKey(const PropertyValue<float>& value) {
// Paint properties
PropertyValue<float> LineLayer::getDefaultLineBlur() {
return {0};
return {0.f};
}
const PropertyValue<float>& LineLayer::getLineBlur() const {
@@ -223,7 +223,7 @@ TransitionOptions LineLayer::getLineDasharrayTransition() const {
}
PropertyValue<float> LineLayer::getDefaultLineGapWidth() {
return {0};
return {0.f};
}
const PropertyValue<float>& LineLayer::getLineGapWidth() const {
@@ -277,7 +277,7 @@ TransitionOptions LineLayer::getLineGradientTransition() const {
}
PropertyValue<float> LineLayer::getDefaultLineOffset() {
return {0};
return {0.f};
}
const PropertyValue<float>& LineLayer::getLineOffset() const {
@@ -304,7 +304,7 @@ TransitionOptions LineLayer::getLineOffsetTransition() const {
}
PropertyValue<float> LineLayer::getDefaultLineOpacity() {
return {1};
return {1.f};
}
const PropertyValue<float>& LineLayer::getLineOpacity() const {
@@ -358,7 +358,7 @@ TransitionOptions LineLayer::getLinePatternTransition() const {
}
PropertyValue<std::array<float, 2>> LineLayer::getDefaultLineTranslate() {
return {{{0, 0}}};
return {{{0.f, 0.f}}};
}
const PropertyValue<std::array<float, 2>>& LineLayer::getLineTranslate() const {
@@ -412,7 +412,7 @@ TransitionOptions LineLayer::getLineTranslateAnchorTransition() const {
}
PropertyValue<float> LineLayer::getDefaultLineWidth() {
return {1};
return {1.f};
}
const PropertyValue<float>& LineLayer::getLineWidth() const {

View File

@@ -28,7 +28,7 @@ struct LineJoin : DataDrivenLayoutProperty<LineJoinType> {
struct LineMiterLimit : LayoutProperty<float> {
static constexpr const char *name() { return "line-miter-limit"; }
static float defaultValue() { return 2; }
static float defaultValue() { return 2.f; }
};
struct LineRoundLimit : LayoutProperty<float> {
@@ -38,11 +38,11 @@ struct LineRoundLimit : LayoutProperty<float> {
struct LineSortKey : DataDrivenLayoutProperty<float> {
static constexpr const char *name() { return "line-sort-key"; }
static float defaultValue() { return 0; }
static float defaultValue() { return 0.f; }
};
struct LineBlur : DataDrivenPaintProperty<float, attributes::blur, uniforms::blur> {
static float defaultValue() { return 0; }
static float defaultValue() { return 0.f; }
};
struct LineColor : DataDrivenPaintProperty<Color, attributes::color, uniforms::color> {
@@ -54,23 +54,23 @@ struct LineDasharray : CrossFadedPaintProperty<std::vector<float>> {
};
struct LineFloorWidth : DataDrivenPaintProperty<float, attributes::floorwidth, uniforms::floorwidth> {
static float defaultValue() { return 1; }
static float defaultValue() { return 1.f; }
using EvaluatorType = DataDrivenPropertyEvaluator<float, true>;
};
struct LineGapWidth : DataDrivenPaintProperty<float, attributes::gapwidth, uniforms::gapwidth> {
static float defaultValue() { return 0; }
static float defaultValue() { return 0.f; }
};
struct LineGradient : ColorRampProperty {
};
struct LineOffset : DataDrivenPaintProperty<float, attributes::offset, uniforms::offset> {
static float defaultValue() { return 0; }
static float defaultValue() { return 0.f; }
};
struct LineOpacity : DataDrivenPaintProperty<float, attributes::opacity, uniforms::opacity> {
static float defaultValue() { return 1; }
static float defaultValue() { return 1.f; }
};
struct LinePattern : CrossFadedDataDrivenPaintProperty<expression::Image, attributes::pattern_to, uniforms::pattern_to, attributes::pattern_from, uniforms::pattern_from> {
@@ -78,7 +78,7 @@ struct LinePattern : CrossFadedDataDrivenPaintProperty<expression::Image, attrib
};
struct LineTranslate : PaintProperty<std::array<float, 2>> {
static std::array<float, 2> defaultValue() { return {{0, 0}}; }
static std::array<float, 2> defaultValue() { return {{0.f, 0.f}}; }
};
struct LineTranslateAnchor : PaintProperty<TranslateAnchorType> {
@@ -86,7 +86,7 @@ struct LineTranslateAnchor : PaintProperty<TranslateAnchorType> {
};
struct LineWidth : DataDrivenPaintProperty<float, attributes::width, uniforms::width> {
static float defaultValue() { return 1; }
static float defaultValue() { return 1.f; }
};
class LineLayoutProperties : public Properties<

View File

@@ -112,7 +112,7 @@ void LocationIndicatorLayer::setTopImage(const PropertyValue<expression::Image>&
// Paint properties
PropertyValue<float> LocationIndicatorLayer::getDefaultAccuracyRadius() {
return {0};
return {0.f};
}
const PropertyValue<float>& LocationIndicatorLayer::getAccuracyRadius() const {
@@ -220,7 +220,7 @@ TransitionOptions LocationIndicatorLayer::getBearingTransition() const {
}
PropertyValue<float> LocationIndicatorLayer::getDefaultBearingImageSize() {
return {1};
return {1.f};
}
const PropertyValue<float>& LocationIndicatorLayer::getBearingImageSize() const {
@@ -247,7 +247,7 @@ TransitionOptions LocationIndicatorLayer::getBearingImageSizeTransition() const
}
PropertyValue<float> LocationIndicatorLayer::getDefaultImageTiltDisplacement() {
return {0};
return {0.f};
}
const PropertyValue<float>& LocationIndicatorLayer::getImageTiltDisplacement() const {
@@ -274,7 +274,7 @@ TransitionOptions LocationIndicatorLayer::getImageTiltDisplacementTransition() c
}
PropertyValue<std::array<double, 3>> LocationIndicatorLayer::getDefaultLocation() {
return {{{0, 0, 0}}};
return {{{0.f, 0.f, 0.f}}};
}
const PropertyValue<std::array<double, 3>>& LocationIndicatorLayer::getLocation() const {
@@ -328,7 +328,7 @@ TransitionOptions LocationIndicatorLayer::getPerspectiveCompensationTransition()
}
PropertyValue<float> LocationIndicatorLayer::getDefaultShadowImageSize() {
return {1};
return {1.f};
}
const PropertyValue<float>& LocationIndicatorLayer::getShadowImageSize() const {
@@ -355,7 +355,7 @@ TransitionOptions LocationIndicatorLayer::getShadowImageSizeTransition() const {
}
PropertyValue<float> LocationIndicatorLayer::getDefaultTopImageSize() {
return {1};
return {1.f};
}
const PropertyValue<float>& LocationIndicatorLayer::getTopImageSize() const {

View File

@@ -56,7 +56,7 @@ struct ImageTiltDisplacement : PaintProperty<float> {
};
struct Location : PaintProperty<std::array<double, 3>> {
static std::array<double, 3> defaultValue() { return {{0, 0, 0}}; }
static std::array<double, 3> defaultValue() { return {{0.f, 0.f, 0.f}}; }
};
struct PerspectiveCompensation : PaintProperty<float> {

View File

@@ -66,7 +66,7 @@ void RasterLayer::Impl::stringifyLayout(rapidjson::Writer<rapidjson::StringBuffe
// Paint properties
PropertyValue<float> RasterLayer::getDefaultRasterBrightnessMax() {
return {1};
return {1.f};
}
const PropertyValue<float>& RasterLayer::getRasterBrightnessMax() const {
@@ -93,7 +93,7 @@ TransitionOptions RasterLayer::getRasterBrightnessMaxTransition() const {
}
PropertyValue<float> RasterLayer::getDefaultRasterBrightnessMin() {
return {0};
return {0.f};
}
const PropertyValue<float>& RasterLayer::getRasterBrightnessMin() const {
@@ -120,7 +120,7 @@ TransitionOptions RasterLayer::getRasterBrightnessMinTransition() const {
}
PropertyValue<float> RasterLayer::getDefaultRasterContrast() {
return {0};
return {0.f};
}
const PropertyValue<float>& RasterLayer::getRasterContrast() const {
@@ -147,7 +147,7 @@ TransitionOptions RasterLayer::getRasterContrastTransition() const {
}
PropertyValue<float> RasterLayer::getDefaultRasterFadeDuration() {
return {300};
return {300.f};
}
const PropertyValue<float>& RasterLayer::getRasterFadeDuration() const {
@@ -174,7 +174,7 @@ TransitionOptions RasterLayer::getRasterFadeDurationTransition() const {
}
PropertyValue<float> RasterLayer::getDefaultRasterHueRotate() {
return {0};
return {0.f};
}
const PropertyValue<float>& RasterLayer::getRasterHueRotate() const {
@@ -201,7 +201,7 @@ TransitionOptions RasterLayer::getRasterHueRotateTransition() const {
}
PropertyValue<float> RasterLayer::getDefaultRasterOpacity() {
return {1};
return {1.f};
}
const PropertyValue<float>& RasterLayer::getRasterOpacity() const {
@@ -255,7 +255,7 @@ TransitionOptions RasterLayer::getRasterResamplingTransition() const {
}
PropertyValue<float> RasterLayer::getDefaultRasterSaturation() {
return {0};
return {0.f};
}
const PropertyValue<float>& RasterLayer::getRasterSaturation() const {

View File

@@ -17,27 +17,27 @@ namespace mbgl {
namespace style {
struct RasterBrightnessMax : PaintProperty<float> {
static float defaultValue() { return 1; }
static float defaultValue() { return 1.f; }
};
struct RasterBrightnessMin : PaintProperty<float> {
static float defaultValue() { return 0; }
static float defaultValue() { return 0.f; }
};
struct RasterContrast : PaintProperty<float> {
static float defaultValue() { return 0; }
static float defaultValue() { return 0.f; }
};
struct RasterFadeDuration : PaintProperty<float> {
static float defaultValue() { return 300; }
static float defaultValue() { return 300.f; }
};
struct RasterHueRotate : PaintProperty<float> {
static float defaultValue() { return 0; }
static float defaultValue() { return 0.f; }
};
struct RasterOpacity : PaintProperty<float> {
static float defaultValue() { return 1; }
static float defaultValue() { return 1.f; }
};
struct RasterResampling : PaintProperty<RasterResamplingType> {
@@ -45,7 +45,7 @@ struct RasterResampling : PaintProperty<RasterResamplingType> {
};
struct RasterSaturation : PaintProperty<float> {
static float defaultValue() { return 0; }
static float defaultValue() { return 0.f; }
};
class RasterPaintProperties : public Properties<

View File

@@ -709,7 +709,7 @@ TransitionOptions SymbolLayer::getIconColorTransition() const {
}
PropertyValue<float> SymbolLayer::getDefaultIconHaloBlur() {
return {0};
return {0.f};
}
const PropertyValue<float>& SymbolLayer::getIconHaloBlur() const {
@@ -763,7 +763,7 @@ TransitionOptions SymbolLayer::getIconHaloColorTransition() const {
}
PropertyValue<float> SymbolLayer::getDefaultIconHaloWidth() {
return {0};
return {0.f};
}
const PropertyValue<float>& SymbolLayer::getIconHaloWidth() const {
@@ -790,7 +790,7 @@ TransitionOptions SymbolLayer::getIconHaloWidthTransition() const {
}
PropertyValue<float> SymbolLayer::getDefaultIconOpacity() {
return {1};
return {1.f};
}
const PropertyValue<float>& SymbolLayer::getIconOpacity() const {
@@ -817,7 +817,7 @@ TransitionOptions SymbolLayer::getIconOpacityTransition() const {
}
PropertyValue<std::array<float, 2>> SymbolLayer::getDefaultIconTranslate() {
return {{{0, 0}}};
return {{{0.f, 0.f}}};
}
const PropertyValue<std::array<float, 2>>& SymbolLayer::getIconTranslate() const {
@@ -898,7 +898,7 @@ TransitionOptions SymbolLayer::getTextColorTransition() const {
}
PropertyValue<float> SymbolLayer::getDefaultTextHaloBlur() {
return {0};
return {0.f};
}
const PropertyValue<float>& SymbolLayer::getTextHaloBlur() const {
@@ -952,7 +952,7 @@ TransitionOptions SymbolLayer::getTextHaloColorTransition() const {
}
PropertyValue<float> SymbolLayer::getDefaultTextHaloWidth() {
return {0};
return {0.f};
}
const PropertyValue<float>& SymbolLayer::getTextHaloWidth() const {
@@ -979,7 +979,7 @@ TransitionOptions SymbolLayer::getTextHaloWidthTransition() const {
}
PropertyValue<float> SymbolLayer::getDefaultTextOpacity() {
return {1};
return {1.f};
}
const PropertyValue<float>& SymbolLayer::getTextOpacity() const {
@@ -1006,7 +1006,7 @@ TransitionOptions SymbolLayer::getTextOpacityTransition() const {
}
PropertyValue<std::array<float, 2>> SymbolLayer::getDefaultTextTranslate() {
return {{{0, 0}}};
return {{{0.f, 0.f}}};
}
const PropertyValue<std::array<float, 2>>& SymbolLayer::getTextTranslate() const {

View File

@@ -43,7 +43,7 @@ struct IconKeepUpright : LayoutProperty<bool> {
struct IconOffset : DataDrivenLayoutProperty<std::array<float, 2>> {
static constexpr const char *name() { return "icon-offset"; }
static std::array<float, 2> defaultValue() { return {{0, 0}}; }
static std::array<float, 2> defaultValue() { return {{0.f, 0.f}}; }
};
struct IconOptional : LayoutProperty<bool> {
@@ -168,7 +168,7 @@ struct TextMaxWidth : DataDrivenLayoutProperty<float> {
struct TextOffset : DataDrivenLayoutProperty<std::array<float, 2>> {
static constexpr const char *name() { return "text-offset"; }
static std::array<float, 2> defaultValue() { return {{0, 0}}; }
static std::array<float, 2> defaultValue() { return {{0.f, 0.f}}; }
};
struct TextOptional : LayoutProperty<bool> {