- Point2D.Double map_latlng;
- map_latlng = latlng(new Point2D.Double(px_size/2, px_size/2));
-
- BufferedImage myPicture;
- File pngfile = new File(AltosPreferences.logdir(),
- FileCoord(map_latlng, zoom));
- try {
- myPicture = ImageIO.read(pngfile);
- System.out.printf("# Found file %s\n", pngfile);
- } catch (Exception e) {
- // throw new RuntimeException(e);
- System.out.printf("# Failed to find file %s\n", pngfile);
- System.out.printf(" wget -O '%s' 'http://maps.google.com/maps/api/staticmap?center=%.6f,%.6f&zoom=%d&size=%dx%d&sensor=false&maptype=hybrid&format=png32'\n", pngfile, map_latlng.x, map_latlng.y, zoom, px_size, px_size);
- myPicture = new BufferedImage(px_size, px_size,
- BufferedImage.TYPE_INT_RGB);
- }
- setIcon(new ImageIcon( myPicture ));
- g2d = myPicture.createGraphics();