2014-03-05 20 views

回答

0

雖然也基於JS的Wikitude的AR-View與PhoneGap功能是隔離的。 您可以定義urlListeners以在PhoneGap和AR-View之間進行交互,但無法將Wikitude和PhoneGap的JavaScript功能組合在一個html/js文件中。

親切的問候。

發現周圍PhoneGap的細節,在這裏 http://www.wikitude.com/developer/documentation

0

你可以做到這一點通過使用architectsdk增強現實://。

  • 首先創建wikitude世界前通過app.wikitudePlugin.setOnUrlInvokeCallback設置的監聽器。

    var app = { 
    // Define other functions like device onDeviceReady, onDeviceNotSupportedCallback 
    // Add a listener before creating world 
    onDeviceSupportedCallback: function() { 
    
        //Set listener 
        app.wikitudePlugin.setOnUrlInvokeCallback(app.onURLInvoked); 
    
        // Create the world 
        WikitudePlugin.loadARchitectWorld("www/world.html"); 
    }, 
    
    // This listener will be invoked everytime you call document.location = architectsdk://.. in ARchitectWorld 
    onURLInvoked: function(url) {  
        var scheme = 'architectsdk://'; 
        if (url.search(scheme) === 0) { 
         // Remove architectsdk://from string and evaluate function 
         var func = decodeURIComponent(url.substr(scheme.length)); 
         eval(func); 
        }  
    },  
    

    };

  • 然後調用監聽器與document.location = architectsdk://

    $('a').click(function() { 
    var func = encodeURIComponent("window.open('"+this.href+"','_system');"); 
    document.location = "architectsdk://" + func; 
    return false; 
    

    });

相關問題