From 81520e80db7164d958c302e725936afa3d677c78 Mon Sep 17 00:00:00 2001 From: Robin Hawkes Date: Sat, 8 Nov 2014 15:23:08 +0000 Subject: [PATCH] Tidied up examples --- examples/basic-example/main.js | 91 ----------- examples/gpx-example/main.js | 86 +++++------ .../collada-example/data}/files/CU Macky.dae | 0 .../CU-Macky---Center-StairsnoCulling.jpg | Bin .../files/CU-Macky-4sideturretnoCulling.jpg | Bin .../files/CU-Macky-Back-NorthnoCulling.jpg | Bin .../files/CU-Macky-BrickwallnoCulling.jpg | Bin .../files/CU-Macky-East-WingnoCulling.jpg | Bin .../CU-Macky-EastdetaildoornoCulling.jpg | Bin .../data}/files/CU-Macky-EastnoCulling.jpg | Bin .../files/CU-Macky-EntrancenoCulling.jpg | Bin .../files/CU-Macky-Front--TurretnoCulling.jpg | Bin .../CU-Macky-FrontbrickwallnoCulling.jpg | Bin .../data}/files/CU-Macky-FrontnoCulling.jpg | Bin .../files/CU-Macky-FrontofTowernoCulling.jpg | Bin .../files/CU-Macky-NortheastUnivnoCulling.jpg | Bin .../data}/files/CU-Macky-NorthnoCulling.jpg | Bin .../data}/files/CU-Macky-RoofnoCulling.jpg | Bin .../files/CU-Macky-Tower-SidenoCulling.jpg | Bin .../files/CU-Macky-TowerBasenoCulling.jpg | Bin .../data}/files/CU-Macky-TowernoCulling.jpg | Bin .../CU-Macky-_Side_BrickwallnoCulling.jpg | Bin .../data}/files/roofnoCulling.jpg | Bin .../collada-example/data}/sample.kml | 0 .../collada-example/data}/textures.txt | 0 examples/kml/collada-example/index.html | 37 +++++ examples/kml/collada-example/main.js | 142 ++++++++++++++++++ .../point-example}/data/sample.kml | 0 examples/kml/point-example/index.html | 37 +++++ examples/kml/point-example/main.js | 138 +++++++++++++++++ 30 files changed, 397 insertions(+), 134 deletions(-) rename examples/{basic-example/data/kml-model => kml/collada-example/data}/files/CU Macky.dae (100%) rename examples/{basic-example/data/kml-model => kml/collada-example/data}/files/CU-Macky---Center-StairsnoCulling.jpg (100%) rename examples/{basic-example/data/kml-model => kml/collada-example/data}/files/CU-Macky-4sideturretnoCulling.jpg (100%) rename examples/{basic-example/data/kml-model => kml/collada-example/data}/files/CU-Macky-Back-NorthnoCulling.jpg (100%) rename examples/{basic-example/data/kml-model => kml/collada-example/data}/files/CU-Macky-BrickwallnoCulling.jpg (100%) rename examples/{basic-example/data/kml-model => kml/collada-example/data}/files/CU-Macky-East-WingnoCulling.jpg (100%) rename examples/{basic-example/data/kml-model => kml/collada-example/data}/files/CU-Macky-EastdetaildoornoCulling.jpg (100%) rename examples/{basic-example/data/kml-model => kml/collada-example/data}/files/CU-Macky-EastnoCulling.jpg (100%) rename examples/{basic-example/data/kml-model => kml/collada-example/data}/files/CU-Macky-EntrancenoCulling.jpg (100%) rename examples/{basic-example/data/kml-model => kml/collada-example/data}/files/CU-Macky-Front--TurretnoCulling.jpg (100%) rename examples/{basic-example/data/kml-model => kml/collada-example/data}/files/CU-Macky-FrontbrickwallnoCulling.jpg (100%) rename examples/{basic-example/data/kml-model => kml/collada-example/data}/files/CU-Macky-FrontnoCulling.jpg (100%) rename examples/{basic-example/data/kml-model => kml/collada-example/data}/files/CU-Macky-FrontofTowernoCulling.jpg (100%) rename examples/{basic-example/data/kml-model => kml/collada-example/data}/files/CU-Macky-NortheastUnivnoCulling.jpg (100%) rename examples/{basic-example/data/kml-model => kml/collada-example/data}/files/CU-Macky-NorthnoCulling.jpg (100%) rename examples/{basic-example/data/kml-model => kml/collada-example/data}/files/CU-Macky-RoofnoCulling.jpg (100%) rename examples/{basic-example/data/kml-model => kml/collada-example/data}/files/CU-Macky-Tower-SidenoCulling.jpg (100%) rename examples/{basic-example/data/kml-model => kml/collada-example/data}/files/CU-Macky-TowerBasenoCulling.jpg (100%) rename examples/{basic-example/data/kml-model => kml/collada-example/data}/files/CU-Macky-TowernoCulling.jpg (100%) rename examples/{basic-example/data/kml-model => kml/collada-example/data}/files/CU-Macky-_Side_BrickwallnoCulling.jpg (100%) rename examples/{basic-example/data/kml-model => kml/collada-example/data}/files/roofnoCulling.jpg (100%) rename examples/{basic-example/data/kml-model => kml/collada-example/data}/sample.kml (100%) rename examples/{basic-example/data/kml-model => kml/collada-example/data}/textures.txt (100%) create mode 100644 examples/kml/collada-example/index.html create mode 100644 examples/kml/collada-example/main.js rename examples/{basic-example => kml/point-example}/data/sample.kml (100%) create mode 100644 examples/kml/point-example/index.html create mode 100644 examples/kml/point-example/main.js diff --git a/examples/basic-example/main.js b/examples/basic-example/main.js index 32d69cb..8726a2d 100644 --- a/examples/basic-example/main.js +++ b/examples/basic-example/main.js @@ -194,97 +194,6 @@ var choroplethConfig = { var switchboardChoropleth = new VIZI.BlueprintSwitchboard(choroplethConfig); switchboardChoropleth.addToWorld(world); -var kmlConfig = { - input: { - type: "BlueprintInputKML", - options: { - path: "./data/sample.kml" - } - }, - output: { - type: "BlueprintOutputDebugPoints", - options: {} - }, - triggers: [{ - triggerObject: "output", - triggerName: "initialised", - triggerArguments: [], - actionObject: "input", - actionName: "requestData", - actionArguments: [], - actionOutput: {} - }, { - triggerObject: "input", - triggerName: "dataReceived", - triggerArguments: ["kml"], - actionObject: "output", - actionName: "outputPoints", - actionArguments: ["data"], - actionOutput: { - data: { - // Loop through each item in trigger.geoJSON and return a new array of processed values (a map) - process: "map", - itemsObject: "kml", - itemsProperties: "document.placemark", - // Return a new object for each item with the given properties - transformation: { - coordinates: "point.coordinates" - } - } - } - }] -}; - -var switchboardKML = new VIZI.BlueprintSwitchboard(kmlConfig); -switchboardKML.addToWorld(world); - -var colladaConfig = { - input: { - type: "BlueprintInputKML", - options: { - path: "./data/kml-model/sample.kml" - } - }, - output: { - type: "BlueprintOutputCollada", - options: { - modelPathPrefix: "./data/kml-model/" - } - }, - triggers: [{ - triggerObject: "output", - triggerName: "initialised", - triggerArguments: [], - actionObject: "input", - actionName: "requestData", - actionArguments: [], - actionOutput: {} - }, { - triggerObject: "input", - triggerName: "dataReceived", - triggerArguments: ["kml"], - actionObject: "output", - actionName: "outputCollada", - actionArguments: ["collada"], - actionOutput: { - collada: { - // Loop through each item in trigger.geoJSON and return a new array of processed values (a map) - process: "map", - itemsObject: "kml", - itemsProperties: "placemark.model", - // Return a new object for each item with the given properties - transformation: { - coordinates: ["location.longitude", "location.latitude"], - modelPath: "link.href" - } - } - } - }] -}; - -var switchboardCollada = new VIZI.BlueprintSwitchboard(colladaConfig); -switchboardCollada.addToWorld(world); - var clock = new VIZI.Clock(); var update = function() { diff --git a/examples/gpx-example/main.js b/examples/gpx-example/main.js index 436e3e4..c5e7ad9 100644 --- a/examples/gpx-example/main.js +++ b/examples/gpx-example/main.js @@ -4,6 +4,49 @@ var world = new VIZI.World({ var controls = new VIZI.ControlsMap(world.camera); +var gpxConfig = { + input: { + type: "BlueprintInputGPX", + options: { + path: "./data/sample.gpx" + } + }, + output: { + type: "BlueprintOutputDebugLines", + options: {} + }, + triggers: [{ + triggerObject: "output", + triggerName: "initialised", + triggerArguments: [], + actionObject: "input", + actionName: "requestData", + actionArguments: [], + actionOutput: {} + }, { + triggerObject: "input", + triggerName: "dataReceived", + triggerArguments: ["gpx"], + actionObject: "output", + actionName: "outputLines", + actionArguments: ["data"], + actionOutput: { + data: { + process: "map", + itemsObject: "gpx", + itemsProperties: "trk.trkseg.trkpt", + transformation: { + coordinates: ["@lon", "@lat"], + height: "ele" + } + } + } + }] +}; + +var switchboardGPX = new VIZI.BlueprintSwitchboard(gpxConfig); +switchboardGPX.addToWorld(world); + var mapConfig = { input: { type: "BlueprintInputMapTiles", @@ -82,49 +125,6 @@ var mapConfig = { var switchboardMap = new VIZI.BlueprintSwitchboard(mapConfig); switchboardMap.addToWorld(world); -var gpxConfig = { - input: { - type: "BlueprintInputGPX", - options: { - path: "./data/sample.gpx" - } - }, - output: { - type: "BlueprintOutputDebugLines", - options: {} - }, - triggers: [{ - triggerObject: "output", - triggerName: "initialised", - triggerArguments: [], - actionObject: "input", - actionName: "requestData", - actionArguments: [], - actionOutput: {} - }, { - triggerObject: "input", - triggerName: "dataReceived", - triggerArguments: ["gpx"], - actionObject: "output", - actionName: "outputLines", - actionArguments: ["data"], - actionOutput: { - data: { - process: "map", - itemsObject: "gpx", - itemsProperties: "trk.trkseg.trkpt", - transformation: { - coordinates: ["@lon", "@lat"], - height: "ele" - } - } - } - }] -}; - -var switchboardGPX = new VIZI.BlueprintSwitchboard(gpxConfig); -switchboardGPX.addToWorld(world); - var clock = new VIZI.Clock(); var update = function() { diff --git a/examples/basic-example/data/kml-model/files/CU Macky.dae b/examples/kml/collada-example/data/files/CU Macky.dae similarity index 100% rename from examples/basic-example/data/kml-model/files/CU Macky.dae rename to examples/kml/collada-example/data/files/CU Macky.dae diff --git a/examples/basic-example/data/kml-model/files/CU-Macky---Center-StairsnoCulling.jpg b/examples/kml/collada-example/data/files/CU-Macky---Center-StairsnoCulling.jpg similarity index 100% rename from examples/basic-example/data/kml-model/files/CU-Macky---Center-StairsnoCulling.jpg rename to examples/kml/collada-example/data/files/CU-Macky---Center-StairsnoCulling.jpg diff --git a/examples/basic-example/data/kml-model/files/CU-Macky-4sideturretnoCulling.jpg b/examples/kml/collada-example/data/files/CU-Macky-4sideturretnoCulling.jpg similarity index 100% rename from examples/basic-example/data/kml-model/files/CU-Macky-4sideturretnoCulling.jpg rename to examples/kml/collada-example/data/files/CU-Macky-4sideturretnoCulling.jpg diff --git a/examples/basic-example/data/kml-model/files/CU-Macky-Back-NorthnoCulling.jpg b/examples/kml/collada-example/data/files/CU-Macky-Back-NorthnoCulling.jpg similarity index 100% rename from examples/basic-example/data/kml-model/files/CU-Macky-Back-NorthnoCulling.jpg rename to examples/kml/collada-example/data/files/CU-Macky-Back-NorthnoCulling.jpg diff --git a/examples/basic-example/data/kml-model/files/CU-Macky-BrickwallnoCulling.jpg b/examples/kml/collada-example/data/files/CU-Macky-BrickwallnoCulling.jpg similarity index 100% rename from examples/basic-example/data/kml-model/files/CU-Macky-BrickwallnoCulling.jpg rename to examples/kml/collada-example/data/files/CU-Macky-BrickwallnoCulling.jpg diff --git a/examples/basic-example/data/kml-model/files/CU-Macky-East-WingnoCulling.jpg b/examples/kml/collada-example/data/files/CU-Macky-East-WingnoCulling.jpg similarity index 100% rename from examples/basic-example/data/kml-model/files/CU-Macky-East-WingnoCulling.jpg rename to examples/kml/collada-example/data/files/CU-Macky-East-WingnoCulling.jpg diff --git a/examples/basic-example/data/kml-model/files/CU-Macky-EastdetaildoornoCulling.jpg b/examples/kml/collada-example/data/files/CU-Macky-EastdetaildoornoCulling.jpg similarity index 100% rename from examples/basic-example/data/kml-model/files/CU-Macky-EastdetaildoornoCulling.jpg rename to examples/kml/collada-example/data/files/CU-Macky-EastdetaildoornoCulling.jpg diff --git a/examples/basic-example/data/kml-model/files/CU-Macky-EastnoCulling.jpg b/examples/kml/collada-example/data/files/CU-Macky-EastnoCulling.jpg similarity index 100% rename from examples/basic-example/data/kml-model/files/CU-Macky-EastnoCulling.jpg rename to examples/kml/collada-example/data/files/CU-Macky-EastnoCulling.jpg diff --git a/examples/basic-example/data/kml-model/files/CU-Macky-EntrancenoCulling.jpg b/examples/kml/collada-example/data/files/CU-Macky-EntrancenoCulling.jpg similarity index 100% rename from examples/basic-example/data/kml-model/files/CU-Macky-EntrancenoCulling.jpg rename to examples/kml/collada-example/data/files/CU-Macky-EntrancenoCulling.jpg diff --git a/examples/basic-example/data/kml-model/files/CU-Macky-Front--TurretnoCulling.jpg b/examples/kml/collada-example/data/files/CU-Macky-Front--TurretnoCulling.jpg similarity index 100% rename from examples/basic-example/data/kml-model/files/CU-Macky-Front--TurretnoCulling.jpg rename to examples/kml/collada-example/data/files/CU-Macky-Front--TurretnoCulling.jpg diff --git a/examples/basic-example/data/kml-model/files/CU-Macky-FrontbrickwallnoCulling.jpg b/examples/kml/collada-example/data/files/CU-Macky-FrontbrickwallnoCulling.jpg similarity index 100% rename from examples/basic-example/data/kml-model/files/CU-Macky-FrontbrickwallnoCulling.jpg rename to examples/kml/collada-example/data/files/CU-Macky-FrontbrickwallnoCulling.jpg diff --git a/examples/basic-example/data/kml-model/files/CU-Macky-FrontnoCulling.jpg b/examples/kml/collada-example/data/files/CU-Macky-FrontnoCulling.jpg similarity index 100% rename from examples/basic-example/data/kml-model/files/CU-Macky-FrontnoCulling.jpg rename to examples/kml/collada-example/data/files/CU-Macky-FrontnoCulling.jpg diff --git a/examples/basic-example/data/kml-model/files/CU-Macky-FrontofTowernoCulling.jpg b/examples/kml/collada-example/data/files/CU-Macky-FrontofTowernoCulling.jpg similarity index 100% rename from examples/basic-example/data/kml-model/files/CU-Macky-FrontofTowernoCulling.jpg rename to examples/kml/collada-example/data/files/CU-Macky-FrontofTowernoCulling.jpg diff --git a/examples/basic-example/data/kml-model/files/CU-Macky-NortheastUnivnoCulling.jpg b/examples/kml/collada-example/data/files/CU-Macky-NortheastUnivnoCulling.jpg similarity index 100% rename from examples/basic-example/data/kml-model/files/CU-Macky-NortheastUnivnoCulling.jpg rename to examples/kml/collada-example/data/files/CU-Macky-NortheastUnivnoCulling.jpg diff --git a/examples/basic-example/data/kml-model/files/CU-Macky-NorthnoCulling.jpg b/examples/kml/collada-example/data/files/CU-Macky-NorthnoCulling.jpg similarity index 100% rename from examples/basic-example/data/kml-model/files/CU-Macky-NorthnoCulling.jpg rename to examples/kml/collada-example/data/files/CU-Macky-NorthnoCulling.jpg diff --git a/examples/basic-example/data/kml-model/files/CU-Macky-RoofnoCulling.jpg b/examples/kml/collada-example/data/files/CU-Macky-RoofnoCulling.jpg similarity index 100% rename from examples/basic-example/data/kml-model/files/CU-Macky-RoofnoCulling.jpg rename to examples/kml/collada-example/data/files/CU-Macky-RoofnoCulling.jpg diff --git a/examples/basic-example/data/kml-model/files/CU-Macky-Tower-SidenoCulling.jpg b/examples/kml/collada-example/data/files/CU-Macky-Tower-SidenoCulling.jpg similarity index 100% rename from examples/basic-example/data/kml-model/files/CU-Macky-Tower-SidenoCulling.jpg rename to examples/kml/collada-example/data/files/CU-Macky-Tower-SidenoCulling.jpg diff --git a/examples/basic-example/data/kml-model/files/CU-Macky-TowerBasenoCulling.jpg b/examples/kml/collada-example/data/files/CU-Macky-TowerBasenoCulling.jpg similarity index 100% rename from examples/basic-example/data/kml-model/files/CU-Macky-TowerBasenoCulling.jpg rename to examples/kml/collada-example/data/files/CU-Macky-TowerBasenoCulling.jpg diff --git a/examples/basic-example/data/kml-model/files/CU-Macky-TowernoCulling.jpg b/examples/kml/collada-example/data/files/CU-Macky-TowernoCulling.jpg similarity index 100% rename from examples/basic-example/data/kml-model/files/CU-Macky-TowernoCulling.jpg rename to examples/kml/collada-example/data/files/CU-Macky-TowernoCulling.jpg diff --git a/examples/basic-example/data/kml-model/files/CU-Macky-_Side_BrickwallnoCulling.jpg b/examples/kml/collada-example/data/files/CU-Macky-_Side_BrickwallnoCulling.jpg similarity index 100% rename from examples/basic-example/data/kml-model/files/CU-Macky-_Side_BrickwallnoCulling.jpg rename to examples/kml/collada-example/data/files/CU-Macky-_Side_BrickwallnoCulling.jpg diff --git a/examples/basic-example/data/kml-model/files/roofnoCulling.jpg b/examples/kml/collada-example/data/files/roofnoCulling.jpg similarity index 100% rename from examples/basic-example/data/kml-model/files/roofnoCulling.jpg rename to examples/kml/collada-example/data/files/roofnoCulling.jpg diff --git a/examples/basic-example/data/kml-model/sample.kml b/examples/kml/collada-example/data/sample.kml similarity index 100% rename from examples/basic-example/data/kml-model/sample.kml rename to examples/kml/collada-example/data/sample.kml diff --git a/examples/basic-example/data/kml-model/textures.txt b/examples/kml/collada-example/data/textures.txt similarity index 100% rename from examples/basic-example/data/kml-model/textures.txt rename to examples/kml/collada-example/data/textures.txt diff --git a/examples/kml/collada-example/index.html b/examples/kml/collada-example/index.html new file mode 100644 index 0000000..cc1c7bf --- /dev/null +++ b/examples/kml/collada-example/index.html @@ -0,0 +1,37 @@ + + + + + ViziCities - KML Collada Example + + + + + + +
+ + + + \ No newline at end of file diff --git a/examples/kml/collada-example/main.js b/examples/kml/collada-example/main.js new file mode 100644 index 0000000..75487d8 --- /dev/null +++ b/examples/kml/collada-example/main.js @@ -0,0 +1,142 @@ +var world = new VIZI.World({ + viewport: document.querySelector("#vizicities-viewport"), + center: new VIZI.LatLon(40.01000594412381, -105.2727379358738) +}); + +var controls = new VIZI.ControlsMap(world.camera); + +var colladaConfig = { + input: { + type: "BlueprintInputKML", + options: { + path: "./data/sample.kml" + } + }, + output: { + type: "BlueprintOutputCollada", + options: { + modelPathPrefix: "./data/" + } + }, + triggers: [{ + triggerObject: "output", + triggerName: "initialised", + triggerArguments: [], + actionObject: "input", + actionName: "requestData", + actionArguments: [], + actionOutput: {} + }, { + triggerObject: "input", + triggerName: "dataReceived", + triggerArguments: ["kml"], + actionObject: "output", + actionName: "outputCollada", + actionArguments: ["collada"], + actionOutput: { + collada: { + process: "map", + itemsObject: "kml", + itemsProperties: "placemark.model", + transformation: { + coordinates: ["location.longitude", "location.latitude"], + modelPath: "link.href" + } + } + } + }] +}; + +var switchboardCollada = new VIZI.BlueprintSwitchboard(colladaConfig); +switchboardCollada.addToWorld(world); + +var mapConfig = { + input: { + type: "BlueprintInputMapTiles", + options: { + tilePath: "https://a.tiles.mapbox.com/v3/examples.map-i86l3621/{z}/{x}/{y}@2x.png" + } + }, + output: { + type: "BlueprintOutputImageTiles", + options: { + grids: [{ + zoom: 19, + tilesPerDirection: 3, + cullZoom: 17 + }, { + zoom: 18, + tilesPerDirection: 3, + cullZoom: 16 + }, { + zoom: 17, + tilesPerDirection: 3, + cullZoom: 15 + }, { + zoom: 16, + tilesPerDirection: 3, + cullZoom: 14 + }, { + zoom: 15, + tilesPerDirection: 3, + cullZoom: 13 + }, { + zoom: 14, + tilesPerDirection: 3, + cullZoom: 12 + }, { + zoom: 13, + tilesPerDirection: 5, + cullZoom: 11 + }] + } + }, + triggers: [{ + triggerObject: "output", + triggerName: "initialised", + triggerArguments: ["tiles"], + actionObject: "input", + actionName: "requestTiles", + actionArguments: ["tiles"], + actionOutput: { + tiles: "tiles" // actionArg: triggerArg + } + }, { + triggerObject: "output", + triggerName: "gridUpdated", + triggerArguments: ["tiles"], + actionObject: "input", + actionName: "requestTiles", + actionArguments: ["tiles"], + actionOutput: { + tiles: "tiles" // actionArg: triggerArg + } + }, { + triggerObject: "input", + triggerName: "tileReceived", + triggerArguments: ["image", "tile"], + actionObject: "output", + actionName: "outputImageTile", + actionArguments: ["image", "tile"], + actionOutput: { + image: "image", // actionArg: triggerArg + tile: "tile" + } + }] +}; + +var switchboardMap = new VIZI.BlueprintSwitchboard(mapConfig); +switchboardMap.addToWorld(world); + +var clock = new VIZI.Clock(); + +var update = function() { + var delta = clock.getDelta(); + + world.onTick(delta); + world.render(); + + window.requestAnimationFrame(update); +}; + +update(); \ No newline at end of file diff --git a/examples/basic-example/data/sample.kml b/examples/kml/point-example/data/sample.kml similarity index 100% rename from examples/basic-example/data/sample.kml rename to examples/kml/point-example/data/sample.kml diff --git a/examples/kml/point-example/index.html b/examples/kml/point-example/index.html new file mode 100644 index 0000000..e464b00 --- /dev/null +++ b/examples/kml/point-example/index.html @@ -0,0 +1,37 @@ + + + + + ViziCities - KML Point Example + + + + + + +
+ + + + \ No newline at end of file diff --git a/examples/kml/point-example/main.js b/examples/kml/point-example/main.js new file mode 100644 index 0000000..cc3d6c4 --- /dev/null +++ b/examples/kml/point-example/main.js @@ -0,0 +1,138 @@ +var world = new VIZI.World({ + viewport: document.querySelector("#vizicities-viewport") +}); + +var controls = new VIZI.ControlsMap(world.camera); + +var kmlConfig = { + input: { + type: "BlueprintInputKML", + options: { + path: "./data/sample.kml" + } + }, + output: { + type: "BlueprintOutputDebugPoints", + options: {} + }, + triggers: [{ + triggerObject: "output", + triggerName: "initialised", + triggerArguments: [], + actionObject: "input", + actionName: "requestData", + actionArguments: [], + actionOutput: {} + }, { + triggerObject: "input", + triggerName: "dataReceived", + triggerArguments: ["kml"], + actionObject: "output", + actionName: "outputPoints", + actionArguments: ["data"], + actionOutput: { + data: { + process: "map", + itemsObject: "kml", + itemsProperties: "document.placemark", + transformation: { + coordinates: "point.coordinates[0]" + } + } + } + }] +}; + +var switchboardKML = new VIZI.BlueprintSwitchboard(kmlConfig); +switchboardKML.addToWorld(world); + +var mapConfig = { + input: { + type: "BlueprintInputMapTiles", + options: { + tilePath: "https://a.tiles.mapbox.com/v3/examples.map-i86l3621/{z}/{x}/{y}@2x.png" + } + }, + output: { + type: "BlueprintOutputImageTiles", + options: { + grids: [{ + zoom: 19, + tilesPerDirection: 3, + cullZoom: 17 + }, { + zoom: 18, + tilesPerDirection: 3, + cullZoom: 16 + }, { + zoom: 17, + tilesPerDirection: 3, + cullZoom: 15 + }, { + zoom: 16, + tilesPerDirection: 3, + cullZoom: 14 + }, { + zoom: 15, + tilesPerDirection: 3, + cullZoom: 13 + }, { + zoom: 14, + tilesPerDirection: 3, + cullZoom: 12 + }, { + zoom: 13, + tilesPerDirection: 5, + cullZoom: 11 + }] + } + }, + triggers: [{ + triggerObject: "output", + triggerName: "initialised", + triggerArguments: ["tiles"], + actionObject: "input", + actionName: "requestTiles", + actionArguments: ["tiles"], + actionOutput: { + tiles: "tiles" // actionArg: triggerArg + } + }, { + triggerObject: "output", + triggerName: "gridUpdated", + triggerArguments: ["tiles"], + actionObject: "input", + actionName: "requestTiles", + actionArguments: ["tiles"], + actionOutput: { + tiles: "tiles" // actionArg: triggerArg + } + }, { + triggerObject: "input", + triggerName: "tileReceived", + triggerArguments: ["image", "tile"], + actionObject: "output", + actionName: "outputImageTile", + actionArguments: ["image", "tile"], + actionOutput: { + image: "image", // actionArg: triggerArg + tile: "tile" + } + }] +}; + +var switchboardMap = new VIZI.BlueprintSwitchboard(mapConfig); +switchboardMap.addToWorld(world); + +var clock = new VIZI.Clock(); + +var update = function() { + var delta = clock.getDelta(); + + world.onTick(delta); + world.render(); + + window.requestAnimationFrame(update); +}; + +update(); \ No newline at end of file