nitrico/MapViewPager

Add/Remove item

Opened this issue · 5 comments

I'm getting IndexOutOfBoundsException when I add a new item.
Library does not support this?

Hi @pedrofsn,

Right now, it is not supported as markers are added only at the time the map is created. I will try to add the possibility of modifying the fragments and markers after that but it will next week as this one I'm pretty bussy.

Thank you.

Hello, thanks for this library.
I want to create an app that will display contextual markers as the user is moving (gps). it is possible to add/remove markers/fragments yet?

Perhaps more of a temporary fix;

You can add a new item, then call notifyDataSetChanged as always and call .populate on the MapViewPager. In order for this to work, you have to make populate() public or use reflection.

adapter.notifyDataSetChanged();
if (pager.getMap() != null)
      pager.populate();

Dear Sir nitrico, did you solved that index out of bound exception