use of net.osmand.plus.mapmarkers.ItineraryDataHelper.ItineraryGroupInfo in project Osmand by osmandapp.
the class ItinerarySettingsItem method getReader.
@Nullable
@Override
public SettingsItemReader<ItinerarySettingsItem> getReader() {
return new SettingsItemReader<ItinerarySettingsItem>(this) {
@Override
public void readFromStream(@NonNull InputStream inputStream, String entryName) throws IllegalArgumentException {
List<ItineraryGroupInfo> groupInfos = new ArrayList<>();
GPXFile gpxFile = GPXUtilities.loadGPXFile(inputStream, dataHelper.getGPXExtensionsReader(groupInfos));
if (gpxFile.error != null) {
warnings.add(app.getString(R.string.settings_item_read_error, String.valueOf(getType())));
SettingsHelper.LOG.error("Failed read gpx file", gpxFile.error);
} else {
Map<String, MapMarker> markers = new LinkedHashMap<>();
Map<String, MapMarkersGroup> groups = new LinkedHashMap<>();
dataHelper.collectMarkersGroups(gpxFile, groups, groupInfos, markers);
items.addAll(groups.values());
}
}
};
}
Aggregations