首页 文章

如何使用Wikitude添加POI?

提问于
浏览
0

我是开发者AR With POI的新手

我正在为开发人员AR使用wikitude . 我跟随HERE

这段代码在js文件中:

var World = {
    loaded: false,

    init: function initFn() {
        AR.context.onLocationChanged = World.onLocationChanged;
    },
    onLocationChanged: function onLocationChangedFn(latitude, longitude, altitude, accuracy) {

        AR.context.onLocationChanged = null;

        World.createMarkerAtLocation(latitude + 0.01, longitude - 0.0005, altitude - 0.06);
    },
    createMarkerAtLocation: function createMarkerAtLocationFn(latitude, longitude, altitude) {

        var markerLocation = new AR.GeoLocation(latitude, longitude, altitude);
        var markerDrawable = new AR.ImageDrawable(World.markerDrawable, 3);
        var markerObject = new AR.GeoObject(markerLocation, {
            drawables: {
                cam: markerDrawable
            }
        });
    },

    worldLoaded: function worldLoadedFn() {
        document.body.removeChild(document.getElementById('loadingMessage'));
    }
};

World.init();

我在我的android中运行 . 但我的应用程序不是显示POI .

我的问题
1.我如何在我的应用中为POI节目做过

对不起!我的英语不好

1 回答

  • 0

    确保您的设备正在获取位置 . 要查看它是否获得位置,您可以在“function onLocationChangedFn”中添加以下行

    警报('收到位置');

    一旦收到位置,这应该会弹出一条消息 .

相关问题