rizzo-next
Version:
The next generation of Lonely Planet's style guide and pattern library.
1,423 lines (1,422 loc) • 115 kB
JSON
{
"type": "Program",
"start": 0,
"end": 781,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 46,
"column": 0
}
},
"sourceType": "module",
"body": [
{
"type": "ImportDeclaration",
"start": 0,
"end": 35,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 35
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 7,
"end": 18,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 18
}
},
"local": {
"type": "Identifier",
"start": 7,
"end": 18,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 18
}
},
"name": "MapProvider"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 24,
"end": 34,
"loc": {
"start": {
"line": 1,
"column": 24
},
"end": {
"line": 1,
"column": 34
}
},
"value": "./mapbox",
"rawValue": "./mapbox",
"raw": "\"./mapbox\""
}
},
{
"type": "Identifier",
"start": 37,
"end": 756,
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 43,
"column": 2
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 41,
"end": 755,
"loc": {
"start": {
"line": 3,
"column": 4
},
"end": {
"line": 43,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 41,
"end": 47,
"loc": {
"start": {
"line": 3,
"column": 4
},
"end": {
"line": 3,
"column": 10
}
},
"name": "MapAPI"
},
"init": {
"type": "ObjectExpression",
"start": 50,
"end": 755,
"loc": {
"start": {
"line": 3,
"column": 13
},
"end": {
"line": 43,
"column": 1
}
},
"properties": [
{
"type": "Property",
"start": 114,
"end": 233,
"loc": {
"start": {
"line": 8,
"column": 2
},
"end": {
"line": 13,
"column": 3
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 114,
"end": 120,
"loc": {
"start": {
"line": 8,
"column": 2
},
"end": {
"line": 8,
"column": 8
}
},
"name": "launch",
"leadingComments": null
},
"value": {
"type": "FunctionExpression",
"start": 122,
"end": 233,
"loc": {
"start": {
"line": 8,
"column": 10
},
"end": {
"line": 13,
"column": 3
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 131,
"end": 133,
"loc": {
"start": {
"line": 8,
"column": 19
},
"end": {
"line": 8,
"column": 21
}
},
"name": "el"
}
],
"body": {
"type": "BlockStatement",
"start": 135,
"end": 233,
"loc": {
"start": {
"line": 8,
"column": 23
},
"end": {
"line": 13,
"column": 3
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 141,
"end": 198,
"loc": {
"start": {
"line": 9,
"column": 4
},
"end": {
"line": 11,
"column": 7
}
},
"expression": {
"type": "AssignmentExpression",
"start": 141,
"end": 197,
"loc": {
"start": {
"line": 9,
"column": 4
},
"end": {
"line": 11,
"column": 6
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 141,
"end": 157,
"loc": {
"start": {
"line": 9,
"column": 4
},
"end": {
"line": 9,
"column": 20
}
},
"object": {
"type": "ThisExpression",
"start": 141,
"end": 145,
"loc": {
"start": {
"line": 9,
"column": 4
},
"end": {
"line": 9,
"column": 8
}
}
},
"property": {
"type": "Identifier",
"start": 146,
"end": 157,
"loc": {
"start": {
"line": 9,
"column": 9
},
"end": {
"line": 9,
"column": 20
}
},
"name": "mapProvider"
},
"computed": false
},
"right": {
"type": "NewExpression",
"start": 160,
"end": 197,
"loc": {
"start": {
"line": 9,
"column": 23
},
"end": {
"line": 11,
"column": 6
}
},
"callee": {
"type": "Identifier",
"start": 164,
"end": 175,
"loc": {
"start": {
"line": 9,
"column": 27
},
"end": {
"line": 9,
"column": 38
}
},
"name": "MapProvider"
},
"arguments": [
{
"type": "ObjectExpression",
"start": 176,
"end": 196,
"loc": {
"start": {
"line": 9,
"column": 39
},
"end": {
"line": 11,
"column": 5
}
},
"properties": [
{
"type": "Property",
"start": 184,
"end": 190,
"loc": {
"start": {
"line": 10,
"column": 6
},
"end": {
"line": 10,
"column": 12
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 184,
"end": 186,
"loc": {
"start": {
"line": 10,
"column": 6
},
"end": {
"line": 10,
"column": 8
}
},
"name": "el"
},
"value": {
"type": "Identifier",
"start": 188,
"end": 190,
"loc": {
"start": {
"line": 10,
"column": 10
},
"end": {
"line": 10,
"column": 12
}
},
"name": "el"
},
"kind": "init"
}
]
}
]
}
}
},
{
"type": "ExpressionStatement",
"start": 203,
"end": 229,
"loc": {
"start": {
"line": 12,
"column": 4
},
"end": {
"line": 12,
"column": 30
}
},
"expression": {
"type": "CallExpression",
"start": 203,
"end": 228,
"loc": {
"start": {
"line": 12,
"column": 4
},
"end": {
"line": 12,
"column": 29
}
},
"callee": {
"type": "MemberExpression",
"start": 203,
"end": 226,
"loc": {
"start": {
"line": 12,
"column": 4
},
"end": {
"line": 12,
"column": 27
}
},
"object": {
"type": "MemberExpression",
"start": 203,
"end": 219,
"loc": {
"start": {
"line": 12,
"column": 4
},
"end": {
"line": 12,
"column": 20
}
},
"object": {
"type": "ThisExpression",
"start": 203,
"end": 207,
"loc": {
"start": {
"line": 12,
"column": 4
},
"end": {
"line": 12,
"column": 8
}
}
},
"property": {
"type": "Identifier",
"start": 208,
"end": 219,
"loc": {
"start": {
"line": 12,
"column": 9
},
"end": {
"line": 12,
"column": 20
}
},
"name": "mapProvider"
},
"computed": false
},
"property": {
"type": "Identifier",
"start": 220,
"end": 226,
"loc": {
"start": {
"line": 12,
"column": 21
},
"end": {
"line": 12,
"column": 27
}
},
"name": "launch"
},
"computed": false
},
"arguments": []
}
}
]
}
},
"kind": "init",
"leadingComments": [
{
"type": "Block",
"value": "*\n * Setup the map on an element\n * @param el\n ",
"start": 54,
"end": 111,
"loc": {
"start": {
"line": 4,
"column": 2
},
"end": {
"line": 7,
"column": 5
}
},
"range": [
54,
111
]
}
]
},
{
"type": "Property",
"start": 270,
"end": 321,
"loc": {
"start": {
"line": 17,
"column": 2
},
"end": {
"line": 19,
"column": 3
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 270,
"end": 274,
"loc": {
"start": {
"line": 17,
"column": 2
},
"end": {
"line": 17,
"column": 6
}
},
"name": "kill",
"leadingComments": null
},
"value": {
"type": "FunctionExpression",
"start": 276,
"end": 321,
"loc": {
"start": {
"line": 17,
"column": 8
},
"end": {
"line": 19,
"column": 3
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 287,
"end": 321,
"loc": {
"start": {
"line": 17,
"column": 19
},
"end": {
"line": 19,
"column": 3
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 293,
"end": 317,
"loc": {
"start": {
"line": 18,
"column": 4
},
"end": {
"line": 18,
"column": 28
}
},
"expression": {
"type": "CallExpression",
"start": 293,
"end": 316,
"loc": {
"start": {
"line": 18,
"column": 4
},
"end": {
"line": 18,
"column": 27
}
},
"callee": {
"type": "MemberExpression",
"start": 293,
"end": 314,
"loc": {
"start": {
"line": 18,
"column": 4
},
"end": {
"line": 18,
"column": 25
}
},
"object": {
"type": "MemberExpression",
"start": 293,
"end": 309,
"loc": {
"start": {
"line": 18,
"column": 4
},
"end": {
"line": 18,
"column": 20
}
},
"object": {
"type": "ThisExpression",
"start": 293,
"end": 297,
"loc": {
"start": {
"line": 18,
"column": 4
},
"end": {
"line": 18,
"column": 8
}
}
},
"property": {
"type": "Identifier",
"start": 298,
"end": 309,
"loc": {
"start": {
"line": 18,
"column": 9
},
"end": {
"line": 18,
"column": 20
}
},
"name": "mapProvider"
},
"computed": false
},
"property": {
"type": "Identifier",
"start": 310,
"end": 314,
"loc": {
"start": {
"line": 18,
"column": 21
},
"end": {
"line": 18,
"column": 25
}
},
"name": "kill"
},
"computed": false
},
"arguments": []
}
}
]
}
},
"kind": "init",
"leadingComments": [
{
"type": "Block",
"value": "*\n * Destroy the map\n ",
"start": 237,
"end": 267,
"loc": {
"start": {
"line": 14,
"column": 2
},
"end": {
"line": 16,
"column": 5
}
},
"range": [
237,
267
]
}
]
},
{
"type": "Property",
"start": 406,
"end": 473,
"loc": {
"start": {
"line": 24,
"column": 2
},
"end": {
"line": 27,
"column": 3
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 406,
"end": 412,
"loc": {
"start": {
"line": 24,
"column": 2
},
"end": {
"line": 24,
"column": 8
}
},
"name": "redraw",
"leadingComments": null
},
"value": {
"type": "FunctionExpression",
"start": 414,
"end": 473,
"loc": {
"start": {
"line": 24,
"column": 10
},
"end": {
"line": 27,
"column": 3
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 423,
"end": 427,
"loc": {
"start": {
"line": 24,
"column": 19
},
"end": {
"line": 24,
"column": 23
}
},
"name": "pois"
}
],
"body": {
"type": "BlockStatement",
"start": 429,
"end": 473,
"loc": {
"start": {
"line": 24,
"column": 25
},
"end": {
"line": 27,
"column": 3
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 435,
"end": 448,
"loc": {
"start": {
"line": 25,
"column": 4
},
"end": {
"line": 25,
"column": 17
}
},
"expression": {
"type": "CallExpression",
"start": 435,
"end": 447,
"loc": {
"start": {
"line": 25,
"column": 4
},
"end": {
"line": 25,
"column": 16
}
},
"callee": {
"type": "MemberExpression",
"start": 435,
"end": 445,
"loc": {
"start": {
"line": 25,
"column": 4
},
"end": {
"line": 25,
"column": 14
}
},
"object": {
"type": "ThisExpression",
"start": 435,
"end": 439,
"loc": {
"start": {
"line": 25,
"column": 4
},
"end": {
"line": 25,
"column": 8
}
}
},
"property": {
"type": "Identifier",
"start": 440,
"end": 445,
"loc": {
"start": {
"line": 25,
"column": 9
},
"end": {
"line": 25,
"column": 14
}
},
"name": "clear"
},
"computed": false
},
"arguments": []
}
},
{
"type": "ExpressionStatement",
"start": 453,
"end": 469,
"loc": {
"start": {
"line": 26,
"column": 4
},
"end": {
"line": 26,
"column": 20
}
},
"expression": {
"type": "CallExpression",
"start": 453,
"end": 468,
"loc": {
"start": {
"line": 26,
"column": 4
},
"end": {
"line": 26,
"column": 19
}
},
"callee": {
"type": "MemberExpression",
"start": 453,
"end": 462,
"loc": {
"start": {
"line": 26,
"column": 4
},
"end": {
"line": 26,
"column": 13
}
},
"object": {
"type": "ThisExpression",
"start": 453,
"end": 457,
"loc": {
"start": {
"line": 26,
"column": 4
},
"end": {
"line": 26,
"column": 8
}
}
},
"property": {
"type": "Identifier",
"start": 458,
"end": 462,
"loc": {
"start": {
"line": 26,
"column": 9
},
"end": {
"line": 26,
"column": 13
}
},
"name": "plot"
},
"computed": false
},
"arguments": [
{
"type": "Identifier",
"start": 463,
"end": 467,
"loc": {
"start": {
"line": 26,
"column": 14
},
"end": {
"line": 26,
"column": 18
}
},
"name": "pois"
}
]
}
}
]
}
},
"kind": "init",
"leadingComments": [
{
"type": "Block",
"value": "*\n * Redraw the map with a new list of POIS\n * @param {Array} pois\n ",
"start": 325,
"end": 403,
"loc": {
"start": {
"line": 20,
"column": 2
},
"end": {
"line": 23,
"column": 5
}
},
"range": [
325,
403
]
}
]
},
{
"type": "Property",
"start": 546,
"end": 611,
"loc": {
"start": {
"line": 32,
"column": 2
},
"end": {
"line": 34,
"column": 3
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 546,
"end": 550,
"loc": {
"start": {
"line": 32,
"column": 2
},
"end": {
"line": 32,
"column": 6
}
},
"name": "plot",
"leadingComments": null
},
"value": {
"type": "FunctionExpression",
"start": 552,
"end": 611,
"loc": {
"start": {
"line": 32,
"column": 8
},
"end": {
"line": 34,
"column": 3
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 561,
"end": 565,
"loc": {
"start": {
"line": 32,
"column": 17
},
"end": {
"line": 32,
"column": 21
}
},
"name": "pois"
}
],
"body": {
"type": "BlockStatement",
"start": 567,
"end": 611,
"loc": {
"start": {
"line": 32,
"column": 23
},
"end": {
"line": 34,
"column": 3
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 573,
"end": 607,
"loc": {
"start": {
"line": 33,
"column": 4
},
"end": {
"line": 33,
"column": 38
}
},
"expression": {
"type": "CallExpression",
"start": 573,
"end": 606,
"loc": {
"start": {
"line": 33,
"column": 4
},
"end": {
"line": 33,
"column": 37
}
},
"callee": {
"type": "MemberExpression",
"start": 573,
"end": 600,
"loc": {
"start": {
"line": 33,
"column": 4
},
"end": {
"line": 33,
"column": 31
}
},
"object": {
"type": "MemberExpression",
"start": 573,
"end": 589,
"loc": {
"start": {
"line": 33,
"column": 4
},
"end": {
"line": 33,
"column": 20
}
},
"object": {
"type": "ThisExpression",
"start": 573,
"end": 577,
"loc": {
"start": {
"line": 33,
"column": 4
},
"end": {
"line": 33,
"column": 8
}
}
},
"property": {
"type": "Identifier",
"start": 578,
"end": 589,
"loc": {
"start": {
"line": 33,
"column": 9
},
"end": {
"line": 33,
"column": 20
}
},
"name": "mapProvider"
},
"computed": false
},
"property": {
"type": "Identifier",
"start": 590,
"end": 600,
"loc": {
"start": {
"line": 33,
"column": 21
},
"end": {
"line": 33,
"column": 31
}
},
"name": "addMarkers"
},
"computed": false
},
"arguments": [
{
"type": "Identifier",
"start": 601,
"end": 605,
"loc": {
"start": {
"line": 33,
"column": 32
},
"end": {
"line": 33,
"column": 36
}
},
"name": "pois"
}
]
}
}
]
}
},
"kind": "init",
"leadingComments": [
{
"type": "Block",
"value": "*\n * Plots out an array of POIs\n * @param {Array} pois\n ",
"start": 477,
"end": 543,
"loc": {
"start": {
"line": 28,
"column": 2
},
"end": {
"line": 31,
"column": 5
}
},
"range": [
477,
543
]
}
]
},
{
"type": "Property",
"start": 655,
"end": 752,
"loc": {
"start": {
"line": 38,
"column": 2
},
"end": {
"line": 41,
"column": 3
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 655,
"end": 660,
"loc": {
"start": {
"line": 38,
"column": 2
},
"end": {
"line": 38,
"column": 7
}
},
"name": "clear",
"leadingComments": null
},
"value": {
"type": "FunctionExpression",
"start": 662,
"end": 752,
"loc": {
"start": {
"line": 38,
"column": 9
},
"end": {
"line": 41,
"column": 3
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 673,
"end": 752,
"loc": {
"start": {
"line": 38,
"column": 20
},
"end": {
"line": 41,
"column": 3
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 679,
"end": 712,
"loc": {
"start": {
"line": 39,
"column": 4
},
"end": {
"line": 39,
"column": 37
}
},
"expression": {
"type": "CallExpression",
"start": 679,
"end": 711,
"loc": {
"start": {
"line": 39,
"column": 4
},
"end": {
"line": 39,
"column": 36
}
},
"callee": {
"type": "MemberExpression",
"start": 679,
"end": 709,
"loc": {
"start": {
"line": 39,
"column": 4
},
"end": {
"line": 39,
"column": 34
}
},
"object": {
"type": "MemberExpression",
"start": 679,
"end": 695,
"loc": {
"start": {
"line": 39,
"column": 4
},
"end": {
"line": 39,
"column": 20
}
},
"object": {
"type": "ThisExpression",
"start": 679,
"end": 683,
"loc": {
"start": {
"line": 39,
"column": 4
},
"end": {
"line": 39,
"column": 8
}
}
},
"property": {
"type": "Identifier",
"start": 684,
"end": 695,
"loc": {
"start": {
"line": 39,
"column": 9
},
"end": {