Skip to content

Commit

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

Merge branch 'MultiValuedItemLocMap' of
https://github.com/sepinf-inc/IPED.git into MultiValuedItemLocMap
  • Loading branch information
patrickdalla committed May 20, 2024
1 parent b08708e commit 2c993b5
Show file tree
Hide file tree
Showing 4 changed files with 798 additions and 797 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 string);
public abstract void drawJSONFeature(String mid, String jsonFeature);

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,7 +54,9 @@ public void onClicked(String mid, MouseEvent e) {
}
String jsonFeature = mapaPanel.getSelectedJSONFeature();
if (jsonFeature != null) {
mapaPanel.browserCanvas.drawJSONFeature(jsonFeature);
mapaPanel.browserCanvas.drawJSONFeature(mid, jsonFeature);
} else {
mapaPanel.browserCanvas.drawJSONFeature(mid, "");
}

mapViewer.desabilitaTemp = olddesabilitaTemp;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class MapCanvasOpenStreet extends AbstractMapCanvas {
String lastGoogleApiKey = null;
private boolean htmlloaded;
private Semaphore sem;
private String themeScript = MapCanvasOpenStreet.LIGHT_THEME_SCRIPT;;
private String themeScript;

public MapCanvasOpenStreet() {
this.jfxPanel = new JFXPanel();
Expand Down Expand Up @@ -629,12 +629,13 @@ public void run() {
}

@Override
public void drawJSONFeature(String jsonFeature) {
public void drawJSONFeature(String mid, String jsonFeature) {
Platform.runLater(new Runnable() {
public void run() {
try {
if (jsonFeature != null && jsonFeature.length() > 3) {
webEngine.executeScript("try{track.hideLastFeature();track.drawFeature(" + jsonFeature + ");}catch(e){alert(e);}");
webEngine.executeScript("try{track.hideLastFeature();track.drawFeature('" + mid + "', "
+ jsonFeature + ");}catch(e){alert(e);}");
} else {
webEngine.executeScript("try{track.hideLastFeature();}catch(e){alert(e);}");
}
Expand Down
Loading

0 comments on commit 2c993b5

Please sign in to comment.