Start a new topic

Removing exitsting POI and refreshing camera

Removing exitsting POI and refreshing camera


I'm using wikitude service to get a number of relative locations around user then on selection

I need to remove selected POI from camera and then refreshing camera with the new number of POI's locally .

I can destroy all of GeoObjects BUT cannot create new Markers because calling of new Marker(World.markerList) or            


give me error called (undefined is not a function ) !!

Here is my code .. Could you send sample code for creating new markers ?!

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

        World.currentMarkerID = ;

        for (var i = 0; i < World.markerList.length; i++) {

            if ( == World.currentMarkerID)
                 World.currentMarkerINDEX = i ;

      //   alert('markerlist'+ World.temp.length);

      //  AR.context.destroyAll();
        for (var i = 0; i < World.markerList.length; i++) {




        for (var i = 0; i < World.markerList.length; i++) {


           //  new Marker(World.markerList); 

        World.score += 1;
        $("#score-message").html('Score: ' + World.score);










Hi Epic,

you are passing a Marker object to the Marker constructor, this won't work. I'm not 100% sure what you are trying to achieve but please take a look at the code below, it should help. If the user clicks on a Marker, all Markers will be deleted and the same Markers will be recreated. The implementation is just to give you a rough guide and should be optimized.

onMarkerSelected: function onMarkerSelectedFn(marker) {
World.markerList = ;

// Create an AR.ImageResource for the marker idle-image
World.markerDrawable_idle = new AR.ImageResource("assets/marker_idle.png");
// Create an AR.ImageResource for the marker selected-image
World.markerDrawable_selected = new AR.ImageResource("assets/marker_selected.png");
// Create an AR.ImageResource referencing the image that should be displayed for a direction indicator.
World.markerDrawable_directionIndicator = new AR.ImageResource("assets/indi.png");

for (var currentPlaceNr = 0; currentPlaceNr < World.poiData.length; currentPlaceNr++) {
var singlePoi = {
"latitude": parseFloat(World.poiData.latitude),
"longitude": parseFloat(World.poiData.longitude),
"altitude": parseFloat(World.poiData.altitude),
"description": World.poiData.description

To be able to deselect a marker while the user taps on the empty screen,
the World object holds an array that contains each marker.
World.markerList.push(new Marker(singlePoi));



For this to work, add following line to requestDataFromLocal function:

// request POI data
requestDataFromLocal: function requestDataFromLocalFn(centerPointLatitude, centerPointLongitude) {
World.poiData = poiData;


I hope that helps.

Best regards,

Thanks Simon so much .. I need to remove the selected POI Itself from camera ,

I solve it using these lines of code inside onMarkerSelectedFn


Login or Signup to post a comment