org.placelab.demo.mapview
Class BitmapMapBacking
java.lang.Object
org.placelab.demo.mapview.ItemBacking
org.placelab.demo.mapview.BitmapMapBacking
- All Implemented Interfaces:
- MapBacking
- public class BitmapMapBacking
- extends ItemBacking
- implements MapBacking
MapBacking is the data backing for a map to be displayed. Maps have:
+ An origin in gps (upper left)
+ An image that is the map
+ Pixels per latitude, and Pixels per longitude
+ A name
|
Constructor Summary |
BitmapMapBacking(org.eclipse.swt.graphics.ImageData mapImage,
java.lang.String mapImageName,
double originLat,
double originLon,
double pixelsPerLat,
double pixelsPerLon,
java.lang.String mapName)
Use this constructor if you are generating a MapBacking. |
BitmapMapBacking(org.eclipse.swt.graphics.ImageData mapImage,
java.lang.String mapImageName,
java.lang.String mapName,
double originLat,
double originLon,
double upperRightLat,
double upperRightLon)
Use this constructor if you are generating a MapBacking. |
BitmapMapBacking(java.lang.String imageName,
java.lang.String wadRelativeImagePath,
WadData loadedFromWad,
double originLat,
double originLon,
double pixelsPerLat,
double pixelsPerLon,
java.lang.String mapName)
Use this constructor when loading a BitmapMapBacking from a map wad |
BitmapMapBacking(java.lang.String imageName,
java.lang.String wadRelativeImagePath,
WadData loadedFromWad,
java.lang.String mapName,
double originLat,
double originLon,
double upperRightLat,
double upperRightLon)
Use this constructor when loading a BitmapMapBacking from a map wad and you don't
have a pixelsPerLat and pixelsPerLon, but you do have the lat, lon for the
upper right corner of the map. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BitmapMapBacking
public BitmapMapBacking(org.eclipse.swt.graphics.ImageData mapImage,
java.lang.String mapImageName,
double originLat,
double originLon,
double pixelsPerLat,
double pixelsPerLon,
java.lang.String mapName)
- Use this constructor if you are generating a MapBacking.
- Parameters:
mapImage - the image data for the mapmapImageName - the filename for the map image (like amap.png)originLat - the latitude of the upper left of the imageoriginLon - the longitude of the upper left of the imagepixelsPerLat - pixelsPerLon - mapName - the user defined name for the map
BitmapMapBacking
public BitmapMapBacking(org.eclipse.swt.graphics.ImageData mapImage,
java.lang.String mapImageName,
java.lang.String mapName,
double originLat,
double originLon,
double upperRightLat,
double upperRightLon)
- Use this constructor if you are generating a MapBacking.
- Parameters:
mapImage - the image data for the mapmapImageName - the filename for the map image (like amap.png)mapName - the user defined name for the maporiginLat - the latitude of the upper left of the imageoriginLon - the longitude of the upper left of the imageupperRightLon - ...upperRightLat - ...
BitmapMapBacking
public BitmapMapBacking(java.lang.String imageName,
java.lang.String wadRelativeImagePath,
WadData loadedFromWad,
double originLat,
double originLon,
double pixelsPerLat,
double pixelsPerLon,
java.lang.String mapName)
- Use this constructor when loading a BitmapMapBacking from a map wad
- Parameters:
imageName - the filename used for the imagewadRelativeImagePath - the path needed to get the image out of the
wadloadedFromWad - the wad this MapBacking was loaded frommapName - the user defined name for the map
BitmapMapBacking
public BitmapMapBacking(java.lang.String imageName,
java.lang.String wadRelativeImagePath,
WadData loadedFromWad,
java.lang.String mapName,
double originLat,
double originLon,
double upperRightLat,
double upperRightLon)
- Use this constructor when loading a BitmapMapBacking from a map wad and you don't
have a pixelsPerLat and pixelsPerLon, but you do have the lat, lon for the
upper right corner of the map. This has the disadvantage of circumventing
the lazy loading scheme the WadData uses for the images, since we have to
know the image dimensions to use this, which requires loading the image.
- Parameters:
imageName - the filename used for the imagewadRelativeImagePath - the path needed to get the image out of the
wadloadedFromWad - the wad this MapBacking was loaded frommapName - the user defined name for the map
getOriginLat
public double getOriginLat()
- Specified by:
getOriginLat in interface MapBacking
getOriginLon
public double getOriginLon()
- Specified by:
getOriginLon in interface MapBacking
getPixelsPerLat
public double getPixelsPerLat()
getPixelsPerLon
public double getPixelsPerLon()
latitudeToPixels
public int latitudeToPixels(double lat)
longitudeToPixels
public int longitudeToPixels(double lon)
getName
public java.lang.String getName()
- Specified by:
getName in interface MapBacking
getLatHeight
public double getLatHeight()
- Specified by:
getLatHeight in interface MapBacking
getLonWidth
public double getLonWidth()
- Specified by:
getLonWidth in interface MapBacking
getMaxLat
public double getMaxLat()
- Specified by:
getMaxLat in interface MapBacking
getMaxLon
public double getMaxLon()
- Specified by:
getMaxLon in interface MapBacking
containsCoordinate
public boolean containsCoordinate(TwoDCoordinate coord)
- Specified by:
containsCoordinate in interface MapBacking
getPoint
public org.eclipse.swt.graphics.Point getPoint(TwoDCoordinate coord)