コード例 #1
0
 @Override
 public void initLayer(MapPanel map) {
   this.map = map;
   basemapProcessor =
       new BasemapProcessor(
           null, MapZooms.getDefault(), new MapRenderingTypesEncoder("basemap"), 0);
   fillPopupMenuWithActions(map.getPopupMenu());
 }
コード例 #2
0
 private static void generateObf(String[] subArgsArray, IndexCreator ic)
     throws IOException, SQLException, InterruptedException, XmlPullParserException {
   String fn = DataExtractionSettings.getSettings().getMapRenderingTypesFile();
   String regionName = subArgsArray[0];
   MapRenderingTypesEncoder types = new MapRenderingTypesEncoder(fn, regionName);
   ic.generateIndexes(
       new File(subArgsArray[0]),
       new ConsoleProgressImplementation(),
       null,
       MapZooms.getDefault(),
       types,
       log);
 }
コード例 #3
0
  private void createFile(
      CountryRegion global,
      Map<String, Set<TranslateEntity>> translates,
      Map<String, File> polygonFiles,
      String targetObf,
      String targetOsmXml)
      throws IOException, SQLException, InterruptedException, XmlPullParserException {
    File osm = new File(targetOsmXml);
    XmlSerializer serializer = new org.kxml2.io.KXmlSerializer();
    FileOutputStream fous = new FileOutputStream(osm);
    serializer.setOutput(fous, "UTF-8");
    serializer.startDocument("UTF-8", true);
    serializer.startTag(null, "osm");
    serializer.attribute(null, "version", "0.6");
    serializer.attribute(null, "generator", "OsmAnd");
    serializer.setFeature("http://xmlpull.org/v1/doc/features.html#indent-output", true);
    for (CountryRegion r : global.children) {
      r.parent = null;
      processRegion(r, translates, polygonFiles, targetObf, targetOsmXml, "", serializer);
    }
    serializer.endDocument();
    serializer.flush();
    fous.close();

    IndexCreator creator = new IndexCreator(new File(targetObf).getParentFile()); // $NON-NLS-1$
    creator.setMapFileName(new File(targetObf).getName());
    creator.setIndexMap(true);
    creator.setIndexAddress(false);
    creator.setIndexPOI(false);
    creator.setIndexTransport(false);
    creator.setIndexRouting(false);
    MapZooms zooms = MapZooms.parseZooms("5-6");
    creator.generateIndexes(
        osm,
        new ConsoleProgressImplementation(1),
        null,
        zooms,
        new MapRenderingTypesEncoder("regions"),
        log);
  }
コード例 #4
0
 public void setMapZooms(String zooms) {
   // check string
   MapZooms.parseZooms(zooms);
   preferences.put("map_zooms", zooms);
 }
コード例 #5
0
 public MapZooms getMapZooms() {
   String value = preferences.get("map_zooms", MapZooms.MAP_ZOOMS_DEFAULT);
   return MapZooms.parseZooms(value);
 }