opensciencemap / vtm

a vector-tile map library written in java - running on android, desktop and within the browser
GNU Lesser General Public License v3.0
238 stars 176 forks source link

add item in ItemizedLayer #114

Open omainegra opened 10 years ago

omainegra commented 10 years ago

The method addItem(int location, Item item) doesn't work well, I mean the MarkerItem is never added to the layer, I believe is because it doesn't call populate() to recreate the items in the MarkerRenderer. I manage to get it working creating a sub-class and override the method like this:

   @Override
public void addItem(int location, Item item) {
    mItemList.add(location, item);
    populate();
}

With this I get the desired result.