|
@@ -15,6 +15,7 @@ import android.content.DialogInterface;
|
|
import android.graphics.Color;
|
|
import android.graphics.Color;
|
|
import android.location.Location;
|
|
import android.location.Location;
|
|
import android.os.Bundle;
|
|
import android.os.Bundle;
|
|
|
|
+import android.util.Log;
|
|
import android.view.InflateException;
|
|
import android.view.InflateException;
|
|
import android.view.LayoutInflater;
|
|
import android.view.LayoutInflater;
|
|
import android.view.View;
|
|
import android.view.View;
|
|
@@ -200,13 +201,16 @@ public class ThreatMapFragment extends Fragment implements GoogleMap.OnInfoWindo
|
|
* fills the map with markers and circle representing SSIDs
|
|
* fills the map with markers and circle representing SSIDs
|
|
*/
|
|
*/
|
|
private void populateMap() {
|
|
private void populateMap() {
|
|
|
|
+ sMap.clear();
|
|
|
|
+
|
|
UglyDbHelper dbh = new UglyDbHelper(getActivity());
|
|
UglyDbHelper dbh = new UglyDbHelper(getActivity());
|
|
- ArrayList<Record> records = dbh.getAllRecords();
|
|
|
|
|
|
+ ArrayList<Record> records = dbh.getRecordsForFilter(new LogFilter());
|
|
|
|
|
|
HashMap<String, ArrayList<SSIDArea>> threadAreas = new HashMap<String, ArrayList<SSIDArea>>();
|
|
HashMap<String, ArrayList<SSIDArea>> threadAreas = new HashMap<String, ArrayList<SSIDArea>>();
|
|
|
|
|
|
for (Record record : records) {
|
|
for (Record record : records) {
|
|
LatLng location = new LatLng(record.getLatitude(), record.getLongitude());
|
|
LatLng location = new LatLng(record.getLatitude(), record.getLongitude());
|
|
|
|
+ Log.i("location", "lat: " + location.latitude + " long: " + location.longitude);
|
|
ArrayList<SSIDArea> areas;
|
|
ArrayList<SSIDArea> areas;
|
|
if (threadAreas.containsKey(record.getSsid())) {
|
|
if (threadAreas.containsKey(record.getSsid())) {
|
|
areas = threadAreas.get(record.getSsid());
|
|
areas = threadAreas.get(record.getSsid());
|
|
@@ -293,7 +297,6 @@ public class ThreatMapFragment extends Fragment implements GoogleMap.OnInfoWindo
|
|
.findFragmentById(R.id.threatmapfragment);
|
|
.findFragmentById(R.id.threatmapfragment);
|
|
if (mapFragment != null) {
|
|
if (mapFragment != null) {
|
|
sMap = mapFragment.getMap();
|
|
sMap = mapFragment.getMap();
|
|
- populateMap();
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -301,6 +304,7 @@ public class ThreatMapFragment extends Fragment implements GoogleMap.OnInfoWindo
|
|
// map already exists
|
|
// map already exists
|
|
//e.printStackTrace();
|
|
//e.printStackTrace();
|
|
}
|
|
}
|
|
|
|
+
|
|
if (sMap != null) {
|
|
if (sMap != null) {
|
|
sMap.setOnInfoWindowClickListener(this);
|
|
sMap.setOnInfoWindowClickListener(this);
|
|
// custom info window layout
|
|
// custom info window layout
|
|
@@ -322,6 +326,8 @@ public class ThreatMapFragment extends Fragment implements GoogleMap.OnInfoWindo
|
|
return view;
|
|
return view;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+
|
|
|
|
+ populateMap();
|
|
}
|
|
}
|
|
|
|
|
|
// tell the user to enable wifi so map data can be streamed
|
|
// tell the user to enable wifi so map data can be streamed
|