Start a new topic

Browsing POI Capture Screen

Browsing POI Capture Screen


You're welcome ;)

it's work !!! than.s Andreas Schacherbauer

Hi eka,
Did you enable GPS access? 'Trying to find out where you are" is the message we display in case no GPS signal is received.

Best regards,

Andreas

But why when I'm build that's sdk samples in POI Capture Screen .. my POI in camera didn't show up  with error "trying to find out where you are"... help me please :D :{

Yes. In generell the example 'Obtain Poi Data - From Application Model' is your preffered reference point.

Best regards,

Andreas

Thanks Andreas Schacherbauer  for answering ..

Did you mean this code? 

 

   requestDataFromLocal: function requestDataFromLocalFn(lat, lon) {

        var poisNearby = Helper.bringPlacesToUser(myJsonData, lat, lon);
        World.loadPoisFromJsonData(poisNearby);

        /*
        For demo purpose they are relocated randomly around the user using a 'Helper'-function.
        Comment out previous 2 lines and use the following line > instead < to use static values 1:1.
        */

        // World.loadPoisFromJsonData(myJsonData);
    }

var Helper = {

    /*
        For demo purpose only, this method takes poi data and a center point (latitude, longitude) to relocate the given places randomly around the user
    */
    bringPlacesToUser: function bringPlacesToUserFn(poiData, latitude, longitude) {
        for (var i = 0; i < poiData.length; i++) {
            poiData.latitude = latitude + (Math.random() / 5 - 0.1);
            poiData.longitude = longitude + (Math.random() / 5 - 0.1);
            /*
            Note: setting altitude to '0'
            will cause places being shown below / above user,
            depending on the user 's GPS signal altitude.
                Using this contant will ignore any altitude information and always show the places on user-level altitude
            */
            poiData.altitude = AR.CONST.UNKNOWN_ALTITUDE;
        }
        return poiData;
    }
}

Hi eka,
I assume you already had a look at our example which injects poi data from a local json resource? With your local json data in place, call loadPoisFromJsonData and if the json is in the right format, your pois should show up.

You can debug your Architect World using Google Chrome (Android) and Apple Safari (iOS). This might also help you to develop your Architect World/find issues.

Best regards,

Andreas

Hello, I new in wikitude... I want to ask about Browsing POI Capture Screen
why I can't get data from my local json data


var World = {
userLocation: null,
isRequestingData: false,
initiallyLoadedData: false,
initialized: false,
markerDrawable_idle: null,
markerDrawable_selected: null,
markerDrawable_directionIndicator: null,
markerList: ,
currentMarker: null,
locationUpdateCounter: 0,
updatePlacemarkDistancesEveryXLocationUpdates: 10,

loadPoisFromJsonData: function loadPoisFromJsonDataFn(poiData) {
AR.context.destroyAll();

PoiRadar.show();
$('#radarContainer').unbind('click');
$("#radarContainer").click(PoiRadar.clickedRadar);

World.markerList = ;

World.markerDrawable_idle = new AR.ImageResource("assets/marker_idle.png");
World.markerDrawable_selected = new AR.ImageResource("assets/marker_selected.png");
World.markerDrawable_directionIndicator = new AR.ImageResource("assets/indi.png");

for (var currentPlaceNr = 0; currentPlaceNr < poiData.length; currentPlaceNr++) {
var singlePoi = {
"id": poiData.id,
"latitude": parseFloat(poiData.latitude),
"longitude": parseFloat(poiData.longitude),
"altitude": parseFloat(poiData.altitude),
"title": poiData.name,
"description": poiData.description
};
World.markerList.push(new Marker(singlePoi));
}

World.updateDistanceToUserValues();

World.updateStatusMessage(currentPlaceNr + ' places loaded');

$("#panel-distance-range").val(100);
$("#panel-distance-range").slider("refresh");

World.initialized = true;
},

updateDistanceToUserValues: function updateDistanceToUserValuesFn() {
for (var i = 0; i < World.markerList.length; i++) {
World.markerList.distanceToUser = World.markerList.markerObject.locations.distanceToUser();
}
},

updateStatusMessage: function updateStatusMessageFn(message, isWarning) {

var themeToUse = isWarning ? "e" : "c";
var iconToUse = isWarning ? "alert" : "info";

$("#status-message").html(message);
$("#popupInfoButton").buttonMarkup({
theme: themeToUse
});
$("#popupInfoButton").buttonMarkup({
icon: iconToUse
});
},

onPoiDetailMoreButtonClicked: function onPoiDetailMoreButtonClickedFn() {
var currentMarker = World.currentMarker;
var architectSdkUrl = "architectsdk://markerselected?id=" + encodeURIComponent(currentMarker.poiData.id) + "&title=" + encodeURIComponent(currentMarker.poiData.title) + "&description=" + encodeURIComponent(currentMarker.poiData.description);

document.location = architectSdkUrl;
},

// location updates, fired every time you call architectView.setLocation() in native environment
locationChanged: function locationChangedFn(lat, lon, alt, acc) {

World.userLocation = {
'latitude': lat,
'longitude': lon,
'altitude': alt,
'accuracy': acc
};

if (!World.initiallyLoadedData) {
World.requestDataFromLocal(lat, lon);
World.initiallyLoadedData = true;
} else if (World.locationUpdateCounter === 0) {
World.updateDistanceToUserValues();
}

World.locationUpdateCounter = (++World.locationUpdateCounter % World.updatePlacemarkDistancesEveryXLocationUpdates);
},

// fired when user pressed maker in cam
onMarkerSelected: function onMarkerSelectedFn(marker) {
World.currentMarker = marker;

$("#poi-detail-title").html(marker.poiData.title);
$("#poi-detail-description").html(marker.poiData.description);

var distanceToUserValue = (marker.distanceToUser > 999) ? ((marker.distanceToUser / 1000).toFixed(2) + " km") : (Math.round(marker.distanceToUser) + " m");

$("#poi-detail-distance").html(distanceToUserValue);

$("#panel-poidetail").panel("open", 123);

$(".ui-panel-dismiss").unbind("mousedown");

$("#panel-poidetail").on("panelbeforeclose", function(event, ui) {
World.currentMarker.setDeselected(World.currentMarker);
});
},

onScreenClick: function onScreenClickFn() {},

getMaxDistance: function getMaxDistanceFn() {

World.markerList.sort(World.sortByDistanceSortingDescending);

var maxDistanceMeters = World.markerList.distanceToUser;

return maxDistanceMeters * 1.1;
},

updateRangeValues: function updateRangeValuesFn() {

var slider_value = $("#panel-distance-range").val();
var maxRangeMeters = Math.round(World.getMaxDistance() * (slider_value / 100));
var maxRangeValue = (maxRangeMeters > 999) ? ((maxRangeMeters / 1000).toFixed(2) + " km") : (Math.round(maxRangeMeters) + " m");
var placesInRange = World.getNumberOfVisiblePlacesInRange(maxRangeMeters);

$("#panel-distance-value").html(maxRangeValue);
$("#panel-distance-places").html((placesInRange != 1) ? (placesInRange + " Places") : (placesInRange + " Place"));

AR.context.scene.cullingDistance = Math.max(maxRangeMeters, 1);
PoiRadar.setMaxDistance(Math.max(maxRangeMeters, 1));
},

getNumberOfVisiblePlacesInRange: function getNumberOfVisiblePlacesInRangeFn(maxRangeMeters) {
World.markerList.sort(World.sortByDistanceSorting);
for (var i = 0; i < World.markerList.length; i++) {
if (World.markerList.distanceToUser > maxRangeMeters) {
return i;
}
};

return World.markerList.length;
},

handlePanelMovements: function handlePanelMovementsFn() {

$("#panel-distance").on("panelclose", function(event, ui) {
$("#radarContainer").addClass("radarContainer_left");
$("#radarContainer").removeClass("radarContainer_right");
PoiRadar.updatePosition();
});

$("#panel-distance").on("panelopen", function(event, ui) {
$("#radarContainer").removeClass("radarContainer_left");
$("#radarContainer").addClass("radarContainer_right");
PoiRadar.updatePosition();
});
},

showRange: function showRangeFn() {
if (World.markerList.length > 0) {
$('#panel-distance-range').change(function() {
World.updateRangeValues();
});

World.updateRangeValues();
World.handlePanelMovements();

$("#panel-distance").trigger("updatelayout");
$("#panel-distance").panel("open", 1234);
} else {
World.updateStatusMessage('No places available yet', true);
}
},

captureScreen: function captureScreenFn() {
if (World.initialized) {
document.location = "architectsdk://button?action=captureScreen";
}
},

requestDataFromLocal: function requestDataFromLocalFn(lat, lon) {
World.loadPoisFromJsonData(myJsonData1);
}

sortByDistanceSorting: function(a, b) {
return a.distanceToUser - b.distanceToUser;
},
sortByDistanceSortingDescending: function(a, b) {
return b.distanceToUser - a.distanceToUser;
}

};

AR.context.onLocationChanged = World.locationChanged;
AR.context.onScreenClick = World.onScreenClick;

 
Login or Signup to post a comment