Skip to content

Commit

Permalink
Revert "'#2224 and '#2208 Modifications to hide last JSON features if…
Browse files Browse the repository at this point in the history
… a new selected item does not have its own JSON feature."

This reverts commit 34d169c.
  • Loading branch information
patrickdalla committed May 20, 2024
1 parent 34d169c commit 7d13379
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 22 deletions.
2 changes: 1 addition & 1 deletion iped-geo/src/main/java/iped/geo/AbstractMapCanvas.java
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public void drawPolyline(List<StringBuffer> gids) {

}

public abstract void drawJSONFeature(String mid, String jsonFeature);
public abstract void drawJSONFeature(String string);

public void drawJSONFeatures(String[] jsonFeatures) {
// TODO Auto-generated method stub
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ public void onClicked(String mid, MouseEvent e) {
}
String jsonFeature = mapaPanel.getSelectedJSONFeature();
if (jsonFeature != null) {
mapaPanel.browserCanvas.drawJSONFeature(mid, jsonFeature);
} else {
mapaPanel.browserCanvas.drawJSONFeature(mid, "");
mapaPanel.browserCanvas.drawJSONFeature(jsonFeature);
}

mapViewer.desabilitaTemp = olddesabilitaTemp;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -629,14 +629,12 @@ public void run() {
}

@Override
public void drawJSONFeature(String mid, String jsonFeature) {
public void drawJSONFeature(String jsonFeature) {
Platform.runLater(new Runnable() {
public void run() {
try {
if (jsonFeature != null && jsonFeature.length() > 3) {
webEngine.executeScript("try{track.hideLastFeature();track.drawFeature('" + mid + "', "
+ jsonFeature
+ ");}catch(e){alert(e);}");
webEngine.executeScript("try{track.hideLastFeature();track.drawFeature(" + jsonFeature + ");}catch(e){alert(e);}");
} else {
webEngine.executeScript("try{track.hideLastFeature();}catch(e){alert(e);}");
}
Expand Down
22 changes: 8 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 @@ -275,14 +275,12 @@ L.KML = L.MarkerClusterGroup.extend({
this.addKML(kml, kmlOptions);
}
},
drawFeature(mid, json){
if(this.markers[mid].selected == 'true'){
let l = L.geoJSON(json);
this.geoJSONLayers.push(l);
this.addLayer(l);
drawFeature(json){
let l = L.geoJSON(json);
this.geoJSONLayers.push(l);
this.addLayer(l);

this._map.fitBounds(l.getBounds());
}
this._map.fitBounds(l.getBounds());
},
hideLastFeature(json){
while(this.geoJSONLayers.length>0){
Expand Down Expand Up @@ -777,8 +775,6 @@ L.KML = L.MarkerClusterGroup.extend({
return this.curMark;
},
clearVisibleMarkers(){
this.hideLastFeature();
this.deselectAll();
if(this.curMark){
let mark=this.curMark;
mark.hideDirectionLines();
Expand Down Expand Up @@ -1393,8 +1389,8 @@ L.KMLMarker = L.Marker.extend({
}

if(!e.originalEvent.ctrlKey && !e.originalEvent.shiftKey && this.selected == 'true'){
return; //does nothing as the item is already selected
}
return; //does nothing as the item is already selected
}


if(this.parent){
Expand Down Expand Up @@ -1432,9 +1428,7 @@ L.KMLMarker = L.Marker.extend({
window.app.markerMouseClickedBF(this.id, button, modf);
}

this.parent.hideLastFeature();
this.parent.curMark = this;

this.parent.curMark=this;

var that = this;
}catch(e){
Expand Down

0 comments on commit 7d13379

Please sign in to comment.