mirror of
https://github.com/mapillary/mapillary-js.git
synced 2026-01-25 14:07:28 +00:00
Rename GoogleTilesService to VectorTilesService
This commit is contained in:
parent
7af75b8fec
commit
decea2dcf9
@ -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";
|
||||
|
||||
@ -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);
|
||||
});
|
||||
|
||||
@ -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<Graph>;
|
||||
|
||||
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<Node> {
|
||||
|
||||
@ -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<Node> = new rx.Subject<Node>();
|
||||
@ -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;
|
||||
@ -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`;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user