From decea2dcf94ecc8bb62bd3a35705cdfb4ad70346 Mon Sep 17 00:00:00 2001 From: Johan Gyllenspetz Date: Tue, 1 Mar 2016 12:43:59 -0800 Subject: [PATCH] Rename GoogleTilesService to VectorTilesService --- src/Graph.ts | 2 +- src/component/marker/MarkerComponent.ts | 2 +- src/graph/GraphService.ts | 12 ++++++------ .../{GoogleTilesService.ts => VectorTilesService.ts} | 8 ++++---- src/utils/Urls.ts | 4 ++++ 5 files changed, 16 insertions(+), 12 deletions(-) rename src/graph/{GoogleTilesService.ts => VectorTilesService.ts} (92%) diff --git a/src/Graph.ts b/src/Graph.ts index 9442d03b..711a3746 100644 --- a/src/Graph.ts +++ b/src/Graph.ts @@ -1,8 +1,8 @@ -export {GoogleTilesService} from "./graph/GoogleTilesService"; export {Graph} from "./graph/Graph"; export {GraphService} from "./graph/GraphService"; export {ImageLoadingService} from "./graph/ImageLoadingService"; export {Node} from "./graph/Node"; export {Sequence} from "./graph/Sequence"; export {TilesService} from "./graph/TilesService"; +export {VectorTilesService} from "./graph/VectorTilesService"; export * from "./graph/interfaces/interfaces"; diff --git a/src/component/marker/MarkerComponent.ts b/src/component/marker/MarkerComponent.ts index 539ca6a3..9b66c88c 100644 --- a/src/component/marker/MarkerComponent.ts +++ b/src/component/marker/MarkerComponent.ts @@ -110,7 +110,7 @@ export class MarkerComponent extends Component { .subscribe(this._container.glRenderer.render$); this._disposableMapillaryObject = - this._navigator.graphService.googleTilesService.mapillaryObjects$.subscribe((object: any) => { + this._navigator.graphService.vectorTilesService.mapillaryObjects$.subscribe((object: any) => { let marker: Marker = this.createMarker(object.l.lat, object.l.lon, object.alt); this.addMarker(marker); }); diff --git a/src/graph/GraphService.ts b/src/graph/GraphService.ts index 2a284224..4f13f511 100644 --- a/src/graph/GraphService.ts +++ b/src/graph/GraphService.ts @@ -3,7 +3,7 @@ import * as rx from "rx"; import {IAPINavIm, APIv2} from "../API"; -import {GoogleTilesService, Graph, ImageLoadingService, Node, TilesService} from "../Graph"; +import {VectorTilesService, Graph, ImageLoadingService, Node, TilesService} from "../Graph"; interface IGraphOperation extends Function { (graph: Graph): Graph; @@ -19,11 +19,11 @@ export class GraphService { private _graph$: rx.Observable; private _tilesService: TilesService; - private _googleTilesService: GoogleTilesService; + private _vectorTilesService: VectorTilesService; private _imageLoadingService: ImageLoadingService; constructor (apiV2: APIv2) { - this._googleTilesService = new GoogleTilesService(); + this._vectorTilesService = new VectorTilesService(); this._tilesService = new TilesService(apiV2); this._imageLoadingService = new ImageLoadingService(); @@ -55,7 +55,7 @@ export class GraphService { }).publish(); this._cachedNode$.connect(); this._cachedNode$.subscribe(this._tilesService.cacheNode$); - this._cachedNode$.subscribe(this._googleTilesService.cacheNode$); + this._cachedNode$.subscribe(this._vectorTilesService.cacheNode$); this._cachedNode$.map((node: Node) => { return (graph: Graph): Graph => { @@ -88,8 +88,8 @@ export class GraphService { return this._imageLoadingService; } - public get googleTilesService(): GoogleTilesService { - return this._googleTilesService; + public get vectorTilesService(): VectorTilesService { + return this._vectorTilesService; } public node$(key: string): rx.Observable { diff --git a/src/graph/GoogleTilesService.ts b/src/graph/VectorTilesService.ts similarity index 92% rename from src/graph/GoogleTilesService.ts rename to src/graph/VectorTilesService.ts index ce83edf2..97deb65c 100644 --- a/src/graph/GoogleTilesService.ts +++ b/src/graph/VectorTilesService.ts @@ -8,8 +8,9 @@ import * as rx from "rx"; import {IGoogleTile, GoogleTiles} from "../Geo"; import {Node} from "../Graph"; +import {Urls} from "../Utils"; -export class GoogleTilesService { +export class VectorTilesService { private _googleTiles: GoogleTiles; private _cacheNode$: rx.Subject = new rx.Subject(); @@ -20,7 +21,7 @@ export class GoogleTilesService { constructor () { this._model = new falcor.Model({ - source: new HttpDataSource("http://mapillary-vector.mapillary.io/tiles.json", { + source: new HttpDataSource(Urls.falcorModel(), { crossDomain: true, withCredentials: false, }), @@ -55,7 +56,6 @@ export class GoogleTilesService { object = objects[object]; if (object.rects.length > 1) { delete object.$__path; - console.log(object.rects); ret.push(object); } } @@ -75,4 +75,4 @@ export class GoogleTilesService { } } -export default GoogleTilesService; +export default VectorTilesService; diff --git a/src/utils/Urls.ts b/src/utils/Urls.ts index ad5d573c..ce78bd0a 100644 --- a/src/utils/Urls.ts +++ b/src/utils/Urls.ts @@ -3,6 +3,10 @@ export class Urls { return `https://d1cuyjsrcm0gby.cloudfront.net/${key}/thumb-${size}.jpg?origin=mapillary.webgl`; } + public static falcorModel(): string { + return "http://mapillary-vector.mapillary.io/tiles.json"; + } + public static mesh(key: string): string { return `https://d1cuyjsrcm0gby.cloudfront.net/${key}/sfm/v1.0/atomic_mesh.json`; }