MapViewPager icon indicating copy to clipboard operation
MapViewPager copied to clipboard

Add/Remove item

Open pedrofsn opened this issue 8 years ago • 5 comments

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

pedrofsn avatar May 30 '16 18:05 pedrofsn

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.

nitrico avatar May 31 '16 00:05 nitrico

Thank you.

pedrofsn avatar May 31 '16 17:05 pedrofsn

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?

spiralni avatar Jul 21 '16 05:07 spiralni

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();

mark-dlc avatar Aug 31 '16 12:08 mark-dlc

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

zeeshanrasool91 avatar Mar 21 '17 15:03 zeeshanrasool91