implement map_zoom parameter for index batch creator

git-svn-id: https://osmand.googlecode.com/svn/trunk@729 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8
This commit is contained in:
Victor Shcherb 2010-11-30 14:44:59 +00:00
parent e9294b83cf
commit 01a584e43a
4 changed files with 82 additions and 22 deletions

View file

@ -11,18 +11,17 @@ public class ToDoConstants {
// For 0.5 release
// 105. Input MAP_ZOOMS and MapRenderingTypes xml as parameter for index creator
// 86. Allow to add/edit custom tags to POI objects (Issue)
// 97. For voice navigation consider current speed of vehicle. Especially when speed > 50 pronounce more than 200 m
// 96. Introduce settings for MPH, imperial units
// 104. Add activity to show current loaded indexes and information about them
// _19. colors for road trunk and motorway
// Outside base 0.5 release
// 86. Allow to add/edit custom tags to POI objects (Issue)
// 92. Support poi index with standard map index and unify POI categories (unify done +)
// 96. Introduce settings for MPH, imperial units
// _19. colors for road trunk and motorway
// _12. Fix : find proper location for streets ! centralize them (when create index)?
// _12. Fix : find proper location for streets ! centralize them (when create index)?
///////////////////////////// UNKNOWN STATE ////////////////////
// Unscheduled (complex)
// 65. Intermediate points - for better control routing, to avoid traffic jams ...(?)
@ -35,6 +34,7 @@ public class ToDoConstants {
/////////////////////////// DONE //////////////////////////////
// DONE ANDROID :
// 105. Input MAP_ZOOMS and MapRenderingTypes xml as parameter for index creator
// 99. Implement better file downloader for big files
// 100. Show impoted gpx points (as favorites), sort the by distance
// 91. Invent binary format (minimize disk space, maximize speed)

View file

@ -43,6 +43,7 @@ public class MapZooms {
int zeroLevel = 15;
List<MapZoomPair> list = new ArrayList<MapZoomPair>();
for(String s : split){
s = s.trim();
int i = s.indexOf('-');
if(i == -1){
zeroLevel = Integer.parseInt(s);

View file

@ -57,7 +57,13 @@ public class DataExtractionSettings {
return MapZooms.parseZooms(value);
}
public String getMapZoomsValue(){
return preferences.get("map_zooms", MapZooms.MAP_ZOOMS_DEFAULT);
}
public void setMapZooms(String zooms){
// check string
MapZooms.parseZooms(zooms);
preferences.put("map_zooms", zooms);
}

View file

@ -29,10 +29,12 @@ public class OsmExtractionPreferencesDialog extends JDialog {
private JTextField streetSuffixes;
private JTextField streetDefaultSuffixes;
private JTextField mapZooms;
private JTextField renderingTypesFile;
private JCheckBox useInternet;
private JCheckBox supressWarning;
private JCheckBox loadWholeOsmInfo;
// private JCheckBox supressWarning;
// private JCheckBox loadWholeOsmInfo;
public OsmExtractionPreferencesDialog(Component parent){
super(JOptionPane.getFrameForComponent(parent), true);
@ -75,7 +77,8 @@ public class OsmExtractionPreferencesDialog extends JDialog {
private void createGeneralSection(JPanel root) {
JPanel panel = new JPanel();
panel.setLayout(new GridLayout(3, 1, 5, 5));
// panel.setLayout(new GridLayout(3, 1, 5, 5));
panel.setLayout(new GridLayout(1, 1, 5, 5));
panel.setBorder(BorderFactory.createTitledBorder(Messages.getString("OsmExtractionPreferencesDialog.GENERAL"))); //$NON-NLS-1$
root.add(panel);
@ -84,15 +87,16 @@ public class OsmExtractionPreferencesDialog extends JDialog {
useInternet.setSelected(DataExtractionSettings.getSettings().useInternetToLoadImages());
panel.add(useInternet);
supressWarning = new JCheckBox();
supressWarning.setText(Messages.getString("OsmExtractionPreferencesDialog.DUPLICATED.ID")); //$NON-NLS-1$
supressWarning.setSelected(DataExtractionSettings.getSettings().isSupressWarningsForDuplicatedId());
panel.add(supressWarning);
// supressWarning = new JCheckBox();
// supressWarning.setText(Messages.getString("OsmExtractionPreferencesDialog.DUPLICATED.ID")); //$NON-NLS-1$
// supressWarning.setSelected(DataExtractionSettings.getSettings().isSupressWarningsForDuplicatedId());
// panel.add(supressWarning);
//
// loadWholeOsmInfo = new JCheckBox();
// loadWholeOsmInfo.setText(Messages.getString("OsmExtractionPreferencesDialog.LOAD.WHOLE.OSM")); //$NON-NLS-1$
// loadWholeOsmInfo.setSelected(DataExtractionSettings.getSettings().getLoadEntityInfo());
// panel.add(loadWholeOsmInfo);
loadWholeOsmInfo = new JCheckBox();
loadWholeOsmInfo.setText(Messages.getString("OsmExtractionPreferencesDialog.LOAD.WHOLE.OSM")); //$NON-NLS-1$
loadWholeOsmInfo.setSelected(DataExtractionSettings.getSettings().getLoadEntityInfo());
panel.add(loadWholeOsmInfo);
panel.setMaximumSize(new Dimension(Short.MAX_VALUE, panel.getPreferredSize().height));
}
@ -101,7 +105,7 @@ public class OsmExtractionPreferencesDialog extends JDialog {
JPanel panel = new JPanel();
GridBagLayout l = new GridBagLayout();
panel.setLayout(l);
panel.setBorder(BorderFactory.createTitledBorder(Messages.getString("OsmExtractionPreferencesDialog.NORMALIZE.STREETS"))); //$NON-NLS-1$
panel.setBorder(BorderFactory.createTitledBorder("Map creation parameters"));
root.add(panel);
JLabel label = new JLabel(Messages.getString("OsmExtractionPreferencesDialog.NAME.SUFFIXES")); //$NON-NLS-1$
@ -142,6 +146,48 @@ public class OsmExtractionPreferencesDialog extends JDialog {
constr.gridx = 1;
constr.gridy = 1;
l.setConstraints(streetDefaultSuffixes, constr);
label = new JLabel("Map zooms (specify zoom levels in binary map <= 4)");
panel.add(label);
constr = new GridBagConstraints();
constr.ipadx = 5;
constr.gridx = 0;
constr.gridy = 2;
constr.anchor = GridBagConstraints.WEST;
l.setConstraints(label, constr);
mapZooms = new JTextField();
mapZooms.setText(DataExtractionSettings.getSettings().getMapZoomsValue());
panel.add(mapZooms);
constr = new GridBagConstraints();
constr.weightx = 1;
constr.fill = GridBagConstraints.HORIZONTAL;
constr.ipadx = 5;
constr.gridx = 1;
constr.gridy = 2;
l.setConstraints(mapZooms, constr);
label = new JLabel("Rendering types (xml config to extract osm data) file path");
panel.add(label);
constr = new GridBagConstraints();
constr.ipadx = 5;
constr.gridx = 0;
constr.gridy = 3;
constr.anchor = GridBagConstraints.WEST;
l.setConstraints(label, constr);
renderingTypesFile = new JTextField();
renderingTypesFile.setText(DataExtractionSettings.getSettings().getMapRenderingTypesFile());
panel.add(renderingTypesFile);
constr = new GridBagConstraints();
constr.weightx = 1;
constr.fill = GridBagConstraints.HORIZONTAL;
constr.ipadx = 5;
constr.gridx = 1;
constr.gridy = 3;
l.setConstraints(renderingTypesFile, constr);
panel.setMaximumSize(new Dimension(Short.MAX_VALUE, panel.getPreferredSize().height));
}
@ -175,12 +221,19 @@ public class OsmExtractionPreferencesDialog extends JDialog {
if(settings.useInternetToLoadImages() != useInternet.isSelected()){
settings.setUseInterentToLoadImages(useInternet.isSelected());
}
if(settings.isSupressWarningsForDuplicatedId() != supressWarning.isSelected()){
settings.setSupressWarningsForDuplicatedId (supressWarning.isSelected());
if(!settings.getMapZoomsValue().equals(mapZooms.getText())){
settings.setMapZooms(mapZooms.getText());
}
if(settings.getLoadEntityInfo() != loadWholeOsmInfo.isSelected()){
settings.setLoadEntityInfo(loadWholeOsmInfo.isSelected());
if(!settings.getMapRenderingTypesFile().equals(renderingTypesFile.getText())){
settings.setMapRenderingTypesFile(renderingTypesFile.getText());
}
// if(settings.isSupressWarningsForDuplicatedId() != supressWarning.isSelected()){
// settings.setSupressWarningsForDuplicatedId (supressWarning.isSelected());
// }
// if(settings.getLoadEntityInfo() != loadWholeOsmInfo.isSelected()){
// settings.setLoadEntityInfo(loadWholeOsmInfo.isSelected());
// }
}