Changeset 498

Show
Ignore:
Timestamp:
02/18/08 19:01:41 (9 months ago)
Author:
tom
Message:

making a library from the Processing code

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/processing/Makefile

    r490 r498  
    11modestmaps.jar: 
    2         javac src/com/modestmaps/*.java -cp lib/core.jar -d classes 
     2        javac -sourcepath src/ -cp lib/core.jar -d classes src/com/modestmaps/*.java src/com/modestmaps/core/*.java src/com/modestmaps/providers/*.java src/com/modestmaps/geo/*.java 
    33        jar cvf modestmaps.jar -C classes . 
    44 
  • trunk/processing/src/com/modestmaps/core/Coordinate.java

    r493 r498  
    1 package com.modestmaps
     1package com.modestmaps.core
    22 
    33import processing.core.*; 
  • trunk/processing/src/com/modestmaps/core/MapCenter.java

    r485 r498  
    1 package com.modestmaps
     1package com.modestmaps.core
    22 
    33public class MapCenter { 
  • trunk/processing/src/com/modestmaps/core/Point2f.java

    r485 r498  
    1 package com.modestmaps
     1package com.modestmaps.core
    22 
    33import processing.core.*; 
  • trunk/processing/src/com/modestmaps/geo/AbstractProjection.java

    r485 r498  
    1 package com.modestmaps
     1package com.modestmaps.geo
    22 
    33import processing.core.*; 
     4import com.modestmaps.core.*; 
    45 
    56public abstract class AbstractProjection { 
  • trunk/processing/src/com/modestmaps/geo/LinearProjection.java

    r485 r498  
    1 package com.modestmaps; 
     1package com.modestmaps.geo; 
     2 
     3import com.modestmaps.core.Point2f; 
    24 
    35public class LinearProjection extends AbstractProjection { 
  • trunk/processing/src/com/modestmaps/geo/Location.java

    r485 r498  
    1 package com.modestmaps
     1package com.modestmaps.geo
    22 
    33import processing.core.*; 
  • trunk/processing/src/com/modestmaps/geo/MercatorProjection.java

    r485 r498  
    1 package com.modestmaps
     1package com.modestmaps.geo
    22 
    33import processing.core.*; 
     4import com.modestmaps.core.Point2f; 
    45 
    56public class MercatorProjection extends AbstractProjection { 
  • trunk/processing/src/com/modestmaps/geo/Transformation.java

    r485 r498  
    1 package com.modestmaps; 
     1package com.modestmaps.geo; 
     2 
     3import com.modestmaps.core.Point2f; 
    24 
    35public class Transformation { 
  • trunk/processing/src/com/modestmaps/InteractiveMap.java

    r497 r498  
    1  
    2 import com.modestmaps.*; 
     1package com.modestmaps; 
     2 
    33import processing.core.*; 
    44import java.util.*; 
     5import com.modestmaps.geo.*; 
     6import com.modestmaps.core.*; 
     7import com.modestmaps.providers.*; 
    58 
    69public class InteractiveMap implements PConstants { 
     
    811  // I have made the dumb mistake of getting these wrong before... 
    912  // it's REALLY unlikely you'll want to change them: 
    10   int TILE_WIDTH = 256; 
    11   int TILE_HEIGHT = 256; 
     13  public int TILE_WIDTH = 256; 
     14  public int TILE_HEIGHT = 256; 
    1215   
    1316  // unavoidable right now, for loadImage and float maths 
    14   PApplet p; 
     17  public PApplet p; 
    1518 
    1619  // pan and zoom 
    17   double tx = -TILE_WIDTH/2; // half the world width, at zoom 0 
    18   double ty = -TILE_HEIGHT/2; // half the world height, at zoom 0 
    19   double sc = 1; 
     20  public double tx = -TILE_WIDTH/2; // half the world width, at zoom 0 
     21  public double ty = -TILE_HEIGHT/2; // half the world height, at zoom 0 
     22  public double sc = 1; 
    2023 
    2124  // limit simultaneous calls to loadImage 
    22   int MAX_PENDING = 4; 
     25  public int MAX_PENDING = 4; 
    2326   
    2427  // limit tiles in memory 
    2528  // 256 would be 64 MB, you may want to lower this quite a bit for your app 
    26   int MAX_IMAGES_TO_KEEP = 256; 
     29  public int MAX_IMAGES_TO_KEEP = 256; 
    2730 
    2831  // upping this can help appearances when zooming out, but also loads many more tiles 
    29   int GRID_PADDING = 1; 
     32  public int GRID_PADDING = 1; 
    3033 
    3134  // what kinda maps? 
    32   AbstractMapProvider provider; 
     35  public AbstractMapProvider provider; 
    3336 
    3437  // how big? 
    35   float width, height; 
     38  public float width, height; 
    3639 
    3740  // loading tiles 
    38   Hashtable pending = new Hashtable(); // coord -> TileLoader 
     41  public Hashtable pending = new Hashtable(); // coord -> TileLoader 
    3942  // loaded tiles 
    40   Hashtable images = new Hashtable();  // coord -> PImage 
     43  public Hashtable images = new Hashtable();  // coord -> PImage 
    4144  // coords waiting to load 
    42   Vector queue = new Vector(); 
     45  public Vector queue = new Vector(); 
    4346  // a list of the most recent MAX_IMAGES_TO_KEEP PImages we've seen 
    44   Vector recentImages = new Vector(); 
     47  public Vector recentImages = new Vector(); 
    4548 
    4649  // for sorting coordinates by zoom 
    47   ZoomComparator zoomComparator = new ZoomComparator(); 
     50  public ZoomComparator zoomComparator = new ZoomComparator(); 
    4851 
    4952  // for loading tiles from the inside first 
    50   QueueSorter queueSorter = new QueueSorter(); 
     53  public QueueSorter queueSorter = new QueueSorter(); 
    5154 
    5255  /** default to Microsoft Hybrid */ 
    53   InteractiveMap(PApplet p) { 
     56  public InteractiveMap(PApplet p) { 
    5457    this(p, new Microsoft.HybridProvider()); 
    5558  } 
    5659 
    5760  /** new map using applet width and height, and given provider */ 
    58   InteractiveMap(PApplet p, AbstractMapProvider provider) { 
     61  public InteractiveMap(PApplet p, AbstractMapProvider provider) { 
    5962    this(p, provider, p.width, p.height); 
    6063  } 
    6164 
    6265  /** make a new interactive map, using the given provider, of the given width and height */ 
    63   InteractiveMap(PApplet p, AbstractMapProvider provider, float width, float height) { 
     66  public InteractiveMap(PApplet p, AbstractMapProvider provider, float width, float height) { 
    6467 
    6568    this.p = p; 
     
    7477 
    7578  /** draw the map on the given PApplet */ 
    76   void draw() { 
     79  public void draw() { 
    7780 
    7881    // remember smooth setting so it can be reset  
     
    245248 
    246249  /** @return zoom level of currently visible tile layer */ 
    247   int getZoom() { 
     250  public int getZoom() { 
    248251    return bestZoomForScale((float)sc); 
    249252  } 
    250253 
    251   Location getCenter() { 
     254  public Location getCenter() { 
    252255    return provider.coordinateLocation(getCenterCoordinate()); 
    253256  } 
    254257 
    255   Coordinate getCenterCoordinate() { 
     258  public Coordinate getCenterCoordinate() { 
    256259    float row = (float)(ty*sc/-TILE_WIDTH); 
    257260    float column = (float)(tx*sc/-TILE_HEIGHT); 
     
    260263  } 
    261264 
    262   void setCenter(Coordinate center) { 
     265  public void setCenter(Coordinate center) { 
    263266    //println("setting center to " + center); 
    264267    sc = p.pow(2.0f, center.zoom); 
     
    267270  } 
    268271 
    269   void setCenter(Location location) { 
     272  public void setCenter(Location location) { 
    270273    setCenter(provider.locationCoordinate(location).zoomTo(getZoom())); 
    271274  } 
    272275 
    273   void setCenterZoom(Location location, int zoom) { 
     276  public void setCenterZoom(Location location, int zoom) { 
    274277    setCenter(provider.locationCoordinate(location).zoomTo(zoom)); 
    275278  } 
    276279 
    277280  /** sets scale according to given zoom level, should leave you with pixel perfect tiles */ 
    278   void setZoom(int zoom) { 
     281  public void setZoom(int zoom) { 
    279282    sc = p.pow(2.0f, zoom-1);  
    280283  } 
    281284 
    282   void zoom(int dir) { 
     285  public void zoom(int dir) { 
    283286    sc = p.pow(2.0f, getZoom()+dir);  
    284287  } 
    285288 
    286   void zoomIn() { 
     289  public void zoomIn() { 
    287290    sc = p.pow(2.0f, getZoom()+1);  
    288291  }   
    289292 
    290   void zoomOut() { 
     293  public void zoomOut() { 
    291294    sc = p.pow(2.0f, getZoom()-1);  
    292295  } 
     
    303306  //        public function getCenterZoom():Array 
    304307 
    305   AbstractMapProvider getMapProvider() { 
     308  public AbstractMapProvider getMapProvider() { 
    306309    return this.provider; 
    307310  } 
    308311 
    309   void setMapProvider(AbstractMapProvider provider) { 
     312  public void setMapProvider(AbstractMapProvider provider) { 
    310313    if (this.provider.getClass() != provider.getClass()) { 
    311314      this.provider = provider; 
     
    316319  } 
    317320 
    318   Point2f locationPoint(Location location) { 
     321  public Point2f locationPoint(Location location) { 
    319322    PMatrix m = new PMatrix(); 
    320323    m.translate(width/2, height/2); 
     
    331334  } 
    332335 
    333   Location pointLocation(Point2f point) { 
     336  public Location pointLocation(Point2f point) { 
    334337    return pointLocation(point.x, point.y);  
    335338  } 
    336339 
    337   Location pointLocation(float x, float y) { 
     340  public Location pointLocation(float x, float y) { 
    338341 
    339342    // TODO: create this matrix once and keep it around for drawing and projecting 
     
    361364 
    362365  // TODO: pan by proportion of screen size, not by coordinate grid 
    363   void panUp() { 
     366  public void panUp() { 
    364367    setCenter(getCenterCoordinate().up()); 
    365368  } 
    366   void panDown() { 
     369  public void panDown() { 
    367370    setCenter(getCenterCoordinate().down()); 
    368371  } 
    369   void panLeft() { 
     372  public void panLeft() { 
    370373    setCenter(getCenterCoordinate().left()); 
    371374  } 
    372   void panRight() { 
     375  public void panRight() { 
    373376    setCenter(getCenterCoordinate().right()); 
    374377  } 
    375378 
    376   void panAndZoomIn(Location location) { 
     379  public void panAndZoomIn(Location location) { 
    377380    // TODO: animate 
    378381    setCenterZoom(location, getZoom() + 1); 
    379382  } 
    380383 
    381   void panTo(Location location) { 
     384  public void panTo(Location location) { 
    382385    // TODO: animate 
    383386    setCenter(location); 
     
    410413  /////////////////////////////////////////////////////////////////////// 
    411414 
    412   float scaleForZoom(int zoom) { 
     415  public float scaleForZoom(int zoom) { 
    413416    return p.pow(2.0f, zoom); 
    414417  } 
    415418 
    416   float zoomForScale(float scale) { 
     419  public float zoomForScale(float scale) { 
    417420    return p.log(scale) / p.log(2); 
    418421  } 
    419422 
    420   int bestZoomForScale(float scale) { 
     423  public int bestZoomForScale(float scale) { 
    421424    return (int)p.min(20, p.max(1, (int)p.round(p.log(scale) / p.log(2)))); 
    422425  } 
     
    424427  ////////////////////////////////////////////////////////////////////////// 
    425428 
    426   void mouseDragged() { 
     429  public void mouseDragged() { 
    427430    double dx = (double)(p.mouseX - p.pmouseX) / sc; 
    428431    double dy = (double)(p.mouseY - p.pmouseY) / sc; 
     
    438441  ///////////////////////////////////////////////////////////////// 
    439442 
    440   void grabTile(Coordinate coord) { 
     443  public void grabTile(Coordinate coord) { 
    441444    if (!pending.containsKey(coord) && !queue.contains(coord) && !images.containsKey(coord)) { 
    442445      //    println("adding " + coord.toString() + " to queue"); 
     
    445448  } 
    446449 
    447   class TileLoader implements Runnable { 
     450  public class TileLoader implements Runnable { 
    448451    Coordinate coord; 
    449452    TileLoader(Coordinate coord) { 
     
    467470  // TODO: there could be issues when this is called from within a thread 
    468471  // probably needs synchronizing on images / pending / queue 
    469   void tileDone(Coordinate coord, PImage img) { 
     472  public void tileDone(Coordinate coord, PImage img) { 
    470473    // check if we're still waiting for this (new provider clears pending) 
    471474    // also check if we got something 
     
    487490  } 
    488491 
    489   void processQueue() { 
     492  public void processQueue() { 
    490493    while (pending.size() < MAX_PENDING && queue.size() > 0) { 
    491494      Coordinate coord = (Coordinate)queue.remove(0); 
     
    496499  } 
    497500 
    498   class QueueSorter implements Comparator { 
     501  public class QueueSorter implements Comparator { 
    499502    Coordinate center; 
    500503    public void setCenter(Coordinate center) { 
     
    525528  } 
    526529 
    527   class ZoomComparator implements Comparator { 
     530  public class ZoomComparator implements Comparator { 
    528531    public int compare(Object o1, Object o2) { 
    529532      Coordinate c1 = (Coordinate)o1; 
  • trunk/processing/src/com/modestmaps/providers/AbstractMapProvider.java

    r493 r498  
    1 package com.modestmaps
     1package com.modestmaps.providers
    22 
    33import processing.core.*; 
     4import com.modestmaps.core.*; 
     5import com.modestmaps.geo.*; 
    46 
    57public abstract class AbstractMapProvider { 
  • trunk/processing/src/com/modestmaps/providers/Google.java

    r485 r498  
    11 
    2 package com.modestmaps
     2package com.modestmaps.providers
    33 
    44import processing.core.*; 
     5import com.modestmaps.core.*; 
     6import com.modestmaps.geo.*; 
    57 
    68public class Google { 
     
    3537    }    
    3638    public String getZoomString(Coordinate coordinate) { 
    37       Coordinate coord = Tiles.toGoogleRoad(coordinate.container()); 
     39      Coordinate coord = toGoogleRoad(coordinate.container()); 
    3840      return "x=" + (int)coord.column + "&y=" + (int)coord.row + "&zoom=" + (int)coord.zoom; 
    3941    } 
     
    4648    } 
    4749    public String getZoomString(Coordinate coordinate) { 
    48       return Tiles.toGoogleAerial(coordinate.container()); 
     50      return toGoogleAerial(coordinate.container()); 
    4951    } 
    5052  } 
     
    5759    } 
    5860    public String getZoomString(Coordinate coordinate) { 
    59       Coordinate coord = Tiles.toGoogleRoad(coordinate.container()); 
     61      Coordinate coord = toGoogleRoad(coordinate.container()); 
    6062      return "x=" + (int)coord.column + "&y=" + (int)coord.row + "&zoom=" + (int)coord.zoom; 
    6163    } 
     
    6870    } 
    6971  } 
     72   
     73  public static Coordinate fromGoogleRoad(Coordinate coord) { 
     74    // Return column, row, zoom for Google Road tile x, y, z. 
     75    return new Coordinate(coord.row, coord.column, 17 - coord.zoom); 
     76  } 
     77   
     78  public static Coordinate toGoogleRoad(Coordinate coord) { 
     79    // Return x, y, z for Google Road tile column, row, zoom. 
     80    return new Coordinate(coord.row, coord.column, 17 - coord.zoom); 
     81  } 
     82   
     83  public static Coordinate fromGoogleAerial(String s) { 
     84    // Return column, row, zoom for Google Aerial tile string. 
     85    String rowS = ""; 
     86    String colS = ""; 
     87    for (int i = 0; i < s.length(); i++) { 
     88      switch (s.charAt(i)) { 
     89      case 't': 
     90        rowS += '0'; 
     91        colS += '0'; 
     92        break; 
     93      case 's': 
     94        rowS += '0'; 
     95        colS += '1'; 
     96        break; 
     97      case 'q': 
     98        rowS += '1'; 
     99        colS += '0'; 
     100        break; 
     101      case 'r': 
     102        rowS += '1'; 
     103        colS += '1'; 
     104        break; 
     105      } 
     106    } 
     107    int row = PApplet.unbinary(rowS); 
     108    int col = PApplet.unbinary(colS); 
     109    int zoom = s.length() - 1; 
     110    row = (int)PApplet.pow(2, zoom) - row - 1; 
     111    return new Coordinate( row, col, zoom ); 
     112  } 
     113   
     114  public static String toGoogleAerial(Coordinate coord) { 
     115    // Return string for Google Road tile column, row, zoom. 
     116    int x = (int)coord.column; 
     117    int y = (int)PApplet.pow(2, coord.zoom) - (int)coord.row - 1; 
     118    int z = (int)coord.zoom + 1; 
     119    String yb = PApplet.binary(y,z); 
     120    String xb = PApplet.binary(x,z); 
     121    String string = ""; 
     122    String googleToCorners = "tsqr"; 
     123    for (int c = 0; c < z; c++) { 
     124      string += googleToCorners.charAt(PApplet.unbinary("" + yb.charAt(c) + xb.charAt(c))); 
     125    } 
     126    return string; 
     127  } 
     128 
     129   
    70130 
    71131} 
  • trunk/processing/src/com/modestmaps/providers/Microsoft.java

    r485 r498  
    1 package com.modestmaps
     1package com.modestmaps.providers
    22 
    33import processing.core.*; 
     4import com.modestmaps.core.*; 
     5import com.modestmaps.geo.*; 
    46 
    57public class Microsoft { 
     
    1214 
    1315    public String getZoomString(Coordinate coordinate) { 
    14       return Tiles.toMicrosoft( (int)coordinate.column, (int)coordinate.row, (int)coordinate.zoom ); 
     16      return toMicrosoft( (int)coordinate.column, (int)coordinate.row, (int)coordinate.zoom ); 
    1517    } 
    1618 
     
    5153  } 
    5254 
     55  public static Coordinate fromMicrosoft(String s) { 
     56    // Return column, row, zoom for Microsoft tile string. 
     57    String rowS = ""; 
     58    String colS = ""; 
     59    for (int i = 0; i < s.length(); i++) { 
     60      int v = Integer.parseInt("" + s.charAt(i)); 
     61      String bv = PApplet.binary(v,2); 
     62      rowS += bv.charAt(0); 
     63      colS += bv.charAt(1); 
     64    } 
     65    return new Coordinate(PApplet.unbinary(colS), PApplet.unbinary(rowS), s.length()); 
     66  } 
     67 
     68  public static String toMicrosoft(int col, int row, int zoom) { 
     69    // Return string for Microsoft tile column, row, zoom 
     70    String y = PApplet.binary(row, zoom); 
     71    String x = PApplet.binary(col, zoom); 
     72    String out = ""; 
     73    for (int i = 0; i < zoom; i++) { 
     74      out += PApplet.unbinary("" + y.charAt(i) + x.charAt(i)); 
     75    } 
     76    return out; 
     77  } 
     78 
     79  public static Coordinate fromMicrosoftRoad(String s) { 
     80    // Return column, row, zoom for Microsoft Road tile string. 
     81    return fromMicrosoft(s); 
     82  } 
     83 
     84  public static String toMicrosoftRoad(int col, int row, int zoom) { 
     85    // Return x, y, z for Microsoft Road tile column, row, zoom. 
     86    return toMicrosoft(col, row, zoom); 
     87  } 
     88 
     89 
     90  public static Coordinate fromMicrosoftAerial(String s) { 
     91    // Return column, row, zoom for Microsoft Aerial tile string. 
     92    return fromMicrosoft(s); 
     93  }  
     94 
     95  public static String toMicrosoftAerial(int col, int row, int zoom) { 
     96    // Return x, y, z for Microsoft Aerial tile column, row, zoom. 
     97    return toMicrosoft(col, row, zoom); 
     98  } 
     99 
    53100} 
  • trunk/processing/src/com/modestmaps/providers/Yahoo.java

    r486 r498  
    11 
    2 package com.modestmaps; 
     2package com.modestmaps.providers; 
     3 
     4import processing.core.*; 
     5import com.modestmaps.core.*; 
     6import com.modestmaps.geo.*; 
    37 
    48public class Yahoo { 
     
    1519   
    1620    public static String getZoomString(Coordinate coordinate) { 
    17       coordinate = Tiles.toYahoo(coordinate); 
     21      coordinate = toYahoo(coordinate); 
    1822      return "x="+(int)coordinate.column+"&y="+(int)coordinate.row+"&z="+ (int)coordinate.zoom; 
    1923    } 
     
    4953  } 
    5054 
     55  public static Coordinate fromYahoo(Coordinate coord) { 
     56    // Return column, row, zoom for Yahoo x, y, z. 
     57    return new Coordinate((int)PApplet.pow(2, 18 - coord.zoom - 1), coord.column , 18 - coord.zoom); 
     58  } 
     59 
     60  public static Coordinate toYahoo(Coordinate coord) { 
     61    // Return x, y, z for Yahoo tile column, row, zoom. 
     62    return new Coordinate(coord.row, (int)PApplet.pow(2, coord.zoom - 1) - coord.row - 1, 18 - coord.zoom); 
     63  } 
     64 
     65  public static Coordinate fromYahooRoad(Coordinate coord) { 
     66    // Return column, row, zoom for Yahoo Road tile x, y, z. 
     67    return fromYahoo(coord); 
     68  } 
     69 
     70  public static Coordinate toYahooRoad(Coordinate coord) { 
     71    // Return x, y, z for Yahoo Road tile column, row, zoom. 
     72    return toYahoo(coord); 
     73  } 
     74 
     75  public static Coordinate fromYahooAerial(Coordinate coord) { 
     76    // Return column, row, zoom for Yahoo Aerial tile x, y, z. 
     77    return fromYahoo(coord); 
     78  } 
     79 
     80  public static Coordinate toYahooAerial(Coordinate coord) { 
     81    // Return x, y, z for Yahoo Aerial tile column, row, zoom. 
     82    return toYahoo(coord); 
     83  } 
     84 
    5185} 
    5286 
  • trunk/processing/src/com/modestmaps/StaticMap.java

    r486 r498  
    11package com.modestmaps; 
    22 
     3import com.modestmaps.geo.*; 
     4import com.modestmaps.core.*; 
     5import com.modestmaps.providers.*; 
    36import processing.core.*; 
    47import java.util.Vector; 
    58 
    6 public class MMap { 
     9public class StaticMap { 
    710 
    811  public PApplet parent; 
     
    1215  public Point2f offset; 
    1316 
    14   public MMap(PApplet parent, AbstractMapProvider provider, Point2f dimensions, Location location, int zoom) { 
     17  public StaticMap(PApplet parent, AbstractMapProvider provider, Point2f dimensions, Location location, int zoom) { 
    1518    this.parent = parent; 
    1619    MapCenter center = calculateMapCenter(provider, provider.locationCoordinate(location).zoomTo(zoom)); 
     
    2124  } 
    2225 
    23   public MMap(PApplet parent, AbstractMapProvider provider, Point2f dimensions, Coordinate coordinate, Point2f offset) { 
     26  public StaticMap(PApplet parent, AbstractMapProvider provider, Point2f dimensions, Coordinate coordinate, Point2f offset) { 
    2427    // Instance of a map intended for drawing to an image. 
    2528    // provider 
     
    349352 
    350353      if (verbose) { 
    351         MMap.this.parent.print("Requesting "); 
    352         MMap.this.parent.print(PApplet.join(urls, ", ")); 
    353         MMap.this.parent.println(" - attempt no. " + attempt);// + " in thread', thread.get_ident() 
     354        StaticMap.this.parent.print("Requesting "); 
     355        StaticMap.this.parent.print(PApplet.join(urls, ", ")); 
     356        StaticMap.this.parent.println(" - attempt no. " + attempt);// + " in thread', thread.get_ident() 
    354357      } 
    355358 
     
    364367          } 
    365368          if (type != null) {  
    366             imgs[i] = MMap.this.parent.loadImage(urls[i], type); 
     369            imgs[i] = StaticMap.this.parent.loadImage(urls[i], type); 
    367370          } 
    368371          else { 
    369             imgs[i] = MMap.this.parent.loadImage(urls[i]); 
     372            imgs[i] = StaticMap.this.parent.loadImage(urls[i]); 
    370373          } 
    371374        } 
     
    385388 
    386389      if (verbose) { 
    387         MMap.this.parent.print("Received "); 
    388         MMap.this.parent.print(PApplet.join(urls,", ")); 
    389         MMap.this.parent.println(" - attempt no. " + attempt);// 'in thread', thread.get_ident() 
     390        StaticMap.this.parent.print("Received "); 
     391        StaticMap.this.parent.print(PApplet.join(urls,", ")); 
     392        StaticMap.this.parent.println(" - attempt no. " + attempt);// 'in thread', thread.get_ident() 
    390393      } 
    391394