tourguide
Class PointsOfInterest

java.lang.Object
  extended bytourguide.PointsOfInterest

public class PointsOfInterest
extends java.lang.Object

Produces a MIME document with a location map and a list of points of interest (POI).


Constructor Summary
PointsOfInterest(java.lang.String fileName)
          Loads a POI configuration file.
 
Method Summary
 byte[] createMimeContent(double latitude, double longitude, int imageWidth, int imageHeight)
          Produces a MIME document with a location map and a list of points of interest (POI).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PointsOfInterest

public PointsOfInterest(java.lang.String fileName)
Loads a POI configuration file.
Here is a sample configuration file content:

//-------------------------------------------------------
// PointsOfInterest locations for the TourGuide program.
//-------------------------------------------------------
// POI location format: X-coord Y-coord ID Text
// IDs must be unique.
// Map coordinates: UL corner=[0,0], BR corner=[1.0,1.0])

// Map:
DallasMap.gif

// POIs:
0.7611 0.2681 2 "2001 Bryan Tower"
0.8504 0.2865 4 "Adam's Mark Hotel"
// and so on ...

Parameters:
fileName - the POI configuration file name.
Method Detail

createMimeContent

public byte[] createMimeContent(double latitude,
                                double longitude,
                                int imageWidth,
                                int imageHeight)
Produces a MIME document with a location map and a list of points of interest (POI).

Parameters:
latitude - the location latitude.
longitude - the location longitude.
imageWidth - the requested width of the map image (in pixels).
imageHeight - the requested height of the map image (in pixels).