Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markers not appearing. #186

Open
PythonSyntax1 opened this issue Aug 3, 2019 · 0 comments
Open

Markers not appearing. #186

PythonSyntax1 opened this issue Aug 3, 2019 · 0 comments

Comments

@PythonSyntax1
Copy link

PythonSyntax1 commented Aug 3, 2019

I am running into a very strange issue where saved markers are appearing as they should, but when I add a new marker into the marker list, the new marker either does not appear, or every single marker fails to appear.

This is the code I run when I switch between modes with my choicebox. When I first run the program, I load saved LatLongs into the Marker List. Markers disappear and appear perfectly fine when I switch between modes.

   if (choiceBox.getValue().equals("Journal")) {
        map.addMarkers(Main.getProgram().getJournalMarkerList());
        Main.getProgram().setJournalMode();
        resetListView(2);
        System.out.println("JM");
    } else {
        map.addMarkers(Main.getProgram().getGoalMarkerList());
        Main.getProgram().setGoalMode();
        resetListView(1);
        System.out.println("GM");
    }
}

However, when I run a method that adds a Post, which adds a marker to the JournalMarkerList or the GoalMarkerList, they fail to load on my map. Even if I switch between modes with the code above, they still fail to load. I have checked that the new Marker is in the Marker List. The strange thing is that, the way I'm adding a Marker when I make a post, and the way I'm adding a Marker when I'm loading saved Markers, is exactly the same, so I don't understand why one is appearing and the other is not.

Here is my MarkerList class :

public Marker makeNewMarker(LatLong loc) {
    MarkerOptions markerOptions = new MarkerOptions();
    markerOptions.position(loc);
    Marker marker = new Marker(markerOptions);
    return marker;
} 


public void addJournalMarkerList(LatLong loc) {
    Marker marker = makeNewMarker(loc);
    journalMarkerList.add(marker);
}

public void addGoalMarkerList(LatLong loc) {
    Marker marker = makeNewMarker(loc);
    goalMarkerList.add(marker);
}


public ArrayList<Marker> getJournalMarkerList() {
    return journalMarkerList;
}

public ArrayList<Marker> getGoalMarkerList() {
    return goalMarkerList;
}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant