Skip to content

Commit

Permalink
'#2088 corrects marker checked sync state for items with multiple valued
Browse files Browse the repository at this point in the history
locations
  • Loading branch information
patrickdalla committed Jun 5, 2024
1 parent da52c15 commit fe2d94d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 16 deletions.
3 changes: 1 addition & 2 deletions iped-geo/src/main/java/iped/geo/impl/MapViewer.java
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,7 @@ public void applyCheckedItems() {
Entry<IItemId, Boolean> entry = (Entry<IItemId, Boolean>) iterator.next();
IItemId item = entry.getKey();
if (mapaPanel.hasItem(item)) {
String gid = GetResultsJSWorker.MARKER_PREFIX + item.getSourceId() + "_" + item.getId(); //$NON-NLS-1$ //$NON-NLS-2$
checked.put(gid, entry.getValue());
mapaPanel.addSelection(checked, item, entry.getValue());
}
}
mapaPanel.browserCanvas.sendCheck(checked);
Expand Down
3 changes: 3 additions & 0 deletions iped-geo/src/main/java/iped/geo/js/GetResultsJSWorker.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ protected KMLResult doReloadInBackground() throws Exception {
minlat = 190.0;
maxlat = -190.0;

lastResultBitmap = createCasesEmptyBitmapArray(msource);

IMultiSearchResult results = app.getResults();
Document doc;

Expand Down Expand Up @@ -204,6 +206,7 @@ void addItemGeoToGidLists(IItemId item, Map<IItemId, List<Integer>> gpsItems, St
int finalMapOrder) throws IOException {
int luceneId = app.getIPEDSource().getLuceneId(item);
Document doc = app.getIPEDSource().getSearcher().doc(luceneId);
lastResultBitmap[item.getSourceId()].add(item.getId());

String[] locations = doc.getValues(ExtraProperties.LOCATIONS);

Expand Down
31 changes: 17 additions & 14 deletions iped-geo/src/main/resources/iped/geo/openstreet/L.KML.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,11 +356,7 @@ L.KML = L.MarkerClusterGroup.extend({
checkMarcador: function (id, b, notify){
for(i=0;i<id.length;i++){
mark=this.markers[id[i]];
if(b=='true'){
mark.checked='true';
}else{
mark.checked='false';
}
mark.toogleCheckedAllItems();
mark.atualizaIcone();
}
},
Expand Down Expand Up @@ -1236,12 +1232,7 @@ L.checkMarker = function(id){
marker=track.markers[ind];
}

if(marker.checked=='true'){
marker.checked='false';
}else{
marker.checked='true';
}
marker.atualizaIcone();
marker.toogleCheckedAllItems();
window.app.checkMarkerBF(marker.id, marker.checked=='true');
};

Expand Down Expand Up @@ -1342,20 +1333,32 @@ L.KMLMarker = L.Marker.extend({
this.directionLinesVisible=false;
},
toogleCheckedAllItems: function(){
checked = this.checked;
if(checked == 'true'){
checked='false';
bchecked = this.checked;
checked='false';
if(bchecked == 'true'){
checked='false';
bchecked = false;
}else{
checked='true';
bchecked = true;
}
if(this.bgid){
subitems = this.itemMarkers[this.bgid];
for(var i=0; i<subitems.length; i++){
subitems[i].checked = checked;
subitems[i].atualizaIcone();
let marker_checkbox = document.getElementById('marker_checkbox_'+subitems[i].id);
if(marker_checkbox){
marker_checkbox.checked = bchecked;
}

}
}else{
this.checked = checked;
let marker_checkbox = document.getElementById('marker_checkbox_'+this.id);
if(marker_checkbox){
marker_checkbox.checked = bchecked;
}
this.atualizaIcone();
}
},
Expand Down

0 comments on commit fe2d94d

Please sign in to comment.