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

Commit

Permalink
[ios, macos] override style spec documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
frederoni committed Nov 2, 2016
1 parent 4d0c42e commit 32c93dd
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
18 changes: 17 additions & 1 deletion platform/darwin/scripts/generate-style-code.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,28 @@

const fs = require('fs');
const ejs = require('ejs');
const spec = require('mapbox-gl-style-spec').latest;
const colorParser = require('csscolorparser');

const prefix = 'MGL';
const suffix = 'StyleLayer';

global.isObjectNotArray = function(object) {
return (typeof object === 'object' && !Array.isArray(object));
}

global.override = function(base, overrides) {
Object.keys(overrides).forEach(function(key) {
if (isObjectNotArray(base[key]) && isObjectNotArray(overrides[key])) {
override(base[key], overrides[key]);
} else {
base[key] = overrides[key];
}
});
return base;
}

const spec = override(require('mapbox-gl-style-spec').latest, require('./style-spec-overrides-v8.json'));

global.camelize = function (str) {
return str.replace(/(?:^|-)(.)/g, function (_, x) {
return x.toUpperCase();
Expand Down
7 changes: 7 additions & 0 deletions platform/darwin/scripts/style-spec-overrides-v8.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"layout_symbol": {
"icon-text-fit-padding": {
"doc": "Size of the additional area added to dimensions determined by `icon-text-fit`, in counterclockwise order: top, left, bottom, right."
}
}
}
2 changes: 1 addition & 1 deletion platform/darwin/src/MGLSymbolStyleLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ typedef NS_ENUM(NSUInteger, MGLTextTranslateAnchor) {
@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *iconTextFit;

/**
Size of the additional area added to dimensions determined by `iconTextFit`, in clockwise order: top, right, bottom, left.
Size of the additional area added to dimensions determined by `iconTextFit`, in counterclockwise order: top, left, bottom, right.
This property is measured in points.
Expand Down

0 comments on commit 32c93dd

Please sign in to comment.