Skip to content

Commit

Permalink
fix(VuforiaService): resolve url in createDataSetFromURL
Browse files Browse the repository at this point in the history
  • Loading branch information
speigg committed Apr 20, 2017
1 parent 5826c97 commit 3560a97
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/vuforia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export class VuforiaObjectTracker extends VuforiaTracker {
* Deprecated. Please use createDataSetFromURI instead.
* @deprecated To be removed.
*/
@deprecated('createDataSetFromURI')
@deprecated('createDataSetFromURL')
public createDataSet(url?: string): Promise<DeprecatedVuforiaDataSet> {
if (url && window.document) {
url = resolveURL(url);
Expand All @@ -148,13 +148,19 @@ export class VuforiaObjectTracker extends VuforiaTracker {
* Fetch a dataset from the provided url.
* If successfull, resolves to an id which represents the dataset.
*/
public createDataSetFromURI(uri: string) : Promise<VuforiaDataSetId> {
return this.managerSession.request('ar.vuforia.objectTrackerCreateDataSet', { uri })
public createDataSetFromURL(url: string) : Promise<VuforiaDataSetId> {
if (url && window.document) {
url = resolveURL(url);
}
return this.managerSession.request('ar.vuforia.objectTrackerCreateDataSet', { url })
.then((message: { id: VuforiaDataSetId }) => {
return message.id;
});
}

@deprecated('createDataSetFromURL')
public get createDataSetFromURI() { return this.createDataSetFromURL };

/**
* Load the dataset into memory, and return a promise which
* resolves to the contained trackables
Expand Down

0 comments on commit 3560a97

Please sign in to comment.