Start a new topic

Markers not cleared from world after reload

Hi Support,


I'm developing app with multiple POIs. What I want to achieve is a filter to the POIs based on its category, e.g. restaurant, shops, atms, etc.


I only request data from web service once, and load 15 markers of all categories to world, then I keep the data for multiple categories in a Javascript object. 


After I click a button on the screen named "restaurant", a helper function will help me filter out the "restaurant" I want, then pass a list of JSON poi data to load like

World.loadPoisFromJsonData(results);

 But when I test the app, after click the button "restaurant", the message below is showing the correct number of markers loaded (3).


But in main view, the 15 markers created initially still exist in view, and the 3 new markers stack on the previous ones.


Any way to clear the previous markers? I already reset the marker list inside the World.loadPoisFromJsonData function:

 

/* Empty list of visible markers. */
        World.markerList = [];

 My world is attached.

zip

Hi,


could you please provide the following data:


  • Which version of the SDK are you using?
  • Are you using any of our Extensions (Cordova, Xamarin, Flutter)? If yes, which version are you using?
  • What device does this happen with (model details and OS version)?
  • Is this happening with the sample app or in your own app? If it happens with your own app, Does the sample app work on your device?


Thx and greetings


Nicola

Hi Wikitude,


  • I'm using Wikitude SDK Javascript API 9.10.0
  • I'm using Flutter extension. Flutter version: 2.2.0, dart 2.13.0
  • Device: Samsung Galaxy A52 5G. Android version 11. A full list of system versions in the screenshot attached.
  • I'm coding inside the sample app. I add one folder called 00_MyTestProgram in sample app samples/ folder and add the path of it to flutter assets. I plan to add the AR world to my own flutter app later when I finished developing it.
  • The sample app without modification works just fine. The example: samples\10_BrowsingPois_4_ReloadingContent is reloading POIs without keeping the previous POI on the screen. But the difference between my own world and samples\10_BrowsingPois_4_ReloadingContent is, sample 10.4 is sending another web service request when reloading, while my world is filtering POI data using a helper function without sending new HTTP get request.

Hi,


There are 2 ways to hide a GeoObject:

I would recommend you to run the list of GeoObjects that you have created with the first server call and, when the item does not fit your filter, disable it.


Regards,


Aitor.

Login or Signup to post a comment