Update UnifiedNlp and fix map bug #94

This commit is contained in:
Marvin W 2016-02-22 23:25:03 +01:00
parent 3936a02e1a
commit 9fc9b9a51d
2 changed files with 11 additions and 4 deletions

2
extern/UnifiedNlp vendored

@ -1 +1 @@
Subproject commit eea7ff3c927234e6d958fc8bff92938bcdef1010
Subproject commit bd671aeeff6b13dd1f45d8e3aed27a824cfa62ab

View File

@ -143,7 +143,8 @@ public class BackendMap implements ItemizedLayer.OnItemGestureListener<MarkerIte
public synchronized <T extends MarkerItemMarkup> T add(T markup) {
if (markup == null) return null;
markupMap.put(markup.getId(), markup);
mapView.items().addItem(markup.getMarkerItem(context));
MarkerItem item = markup.getMarkerItem(context);
mapView.items().addItem(item);
redraw();
return markup;
}
@ -171,8 +172,14 @@ public class BackendMap implements ItemizedLayer.OnItemGestureListener<MarkerIte
public synchronized void update(Markup markup) {
if (markup == null) return;
if (markup instanceof MarkerItemMarkup) {
mapView.items().removeItem(mapView.items().getByUid(markup.getId()));
mapView.items().addItem(((MarkerItemMarkup) markup).getMarkerItem(context));
MarkerItem item = mapView.items().getByUid(markup.getId());
if (item != null) {
mapView.items().removeItem(item);
}
item = ((MarkerItemMarkup) markup).getMarkerItem(context);
if (item != null) {
mapView.items().addItem(item);
}
} else if (markup instanceof DrawableMarkup) {
updateDrawableLayer();
mapView.drawables().update();