public class GoogleMapBuilder
extends java.lang.Object
No output is generated until build() is called.
Reference at: http://code.google.com/apis/maps/documentation/
Copyright 2009 Partner Software, Inc.
| Constructor and Description |
|---|
GoogleMapBuilder(java.io.BufferedOutputStream out,
GoogleMapLib.CreationOptions creationOption)
Creates a new GoogleMapBuilder writing to the
passed BufferedOutputStream.
|
GoogleMapBuilder(VfsFile destination)
Creates a new GoogleMapBuilder writing to the
passed VfsFile.
|
GoogleMapBuilder(VfsFile destination,
GoogleMapLib.CreationOptions creationOption)
Creates a new GoogleMapBuilder writing to the
passed VfsFile.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addMapControl(GoogleMapLib.MapComponents component)
Adds passed GoogleMapLib.MapComponent.
|
void |
addMarker(double longitude,
double latitude,
java.lang.String styleName,
java.lang.String htmlInfo)
Adds GoogleMapMarker to this map.
|
void |
addMarker(GoogleMapMarker marker)
Adds GoogleMapMarker to this map.
|
void |
addPolygon(GoogleMapPolygon polygon)
Adds the passed GoogleMapPolygon to the map to be generated
|
void |
addPolygon(java.lang.String lineColor,
XyPolyline line,
int lineWidth,
double lineOpacity,
java.lang.String fillColor,
double fillOpacity)
Creates a GoogleMapPolygon from the passed parameters and
adds to the map to be generated
|
void |
addPolyline(GoogleMapPolyline line)
Adds the passed GoogleMapPolyline to the map to be generated
|
void |
addPolyline(java.lang.String lineColor,
XyPolyline polyline,
int lineWidth,
double lineOpacity)
Generates a GoogleMapPolyline from the passed parameters and
adds it to the map to be generated
|
void |
build()
Generates output to specified destination.
|
void |
setCenter(double longitude,
double latitude)
Sets the starting center position for the map.
|
void |
setGoogleKey(java.lang.String key)
Sets the Google Map key used to allow generated file
to be viewable from a non-local location.
|
void |
setHtmlRefresh(int htmlRefreshInSeconds)
Sets how often the generated html file should reload itself.
|
void |
setMapHeight(int height)
Sets the map height in pixels.
|
void |
setMapOption(GoogleMapLib.MapOptions option,
boolean enable)
Enables or disables the passed option based
on 'enable' value.
|
void |
setMapWidth(int width)
Sets the map width in pixels.
|
void |
setMaximumZoom(int zoom)
Sets the maximum zoom for all MapTypes
The maximum is how far away from the map surface you can get.
|
void |
setMinimumZoom(int zoom)
Sets the minimum zoom for all MapTypes.
|
void |
setStyle(java.lang.String styleName,
java.lang.String url)
Maps the passed style name to the passed url.
|
void |
setTitle(java.lang.String docName)
Sets the title for the generated google map.
|
void |
setZoom(double zoom)
Sets the starting zoom for the map.
|
public GoogleMapBuilder(VfsFile destination) throws java.io.IOException
destination - - VfsFile to write to.java.io.IOException - if an exception occurs creation output stream to passed destination.public GoogleMapBuilder(VfsFile destination, GoogleMapLib.CreationOptions creationOption) throws java.io.IOException
destination - - VfsFile to write to.creationOption - - Flag determining what to build.java.io.IOException - if an exception occurs creation output stream to passed destination.public GoogleMapBuilder(java.io.BufferedOutputStream out,
GoogleMapLib.CreationOptions creationOption)
out - - BufferedOutputStream to write to.creationOption - - Flag determining what to build.public void setCenter(double longitude,
double latitude)
Note, if this method isn't called - the average latitude and longitude of all added objects will be used for center.
longitude - - initial longitude for map center.latitude - - initial latitude for map center.public void setGoogleKey(java.lang.String key)
Key signup can be found at http://code.google.com/apis/maps/signup.html
key - - Google Map key as issued from Google.public void setZoom(double zoom)
zoom - - zoom levelpublic void setTitle(java.lang.String docName)
docName - - Title of documentpublic void setStyle(java.lang.String styleName,
java.lang.String url)
styleName - - Name of style to be definedurl - - url of iconpublic void addMapControl(GoogleMapLib.MapComponents component)
Default map controls are LARGE_MAP_CONTROL and MAP_TYPE_CONTROL
component - - GoogleMapLib.MapComponent to add to map.public void setMapOption(GoogleMapLib.MapOptions option, boolean enable)
option - - GoogleMapLib.MapOptions option to enable/disableenable - - if true, passed option is enabled. Option is disabled otherwise.public void build()
throws java.io.IOException
java.io.IOException - if an exception occurs writing output.public void setMapWidth(int width)
width - - width of map itempublic void setMapHeight(int height)
height - - height of map itempublic void setMinimumZoom(int zoom)
zoom - - minimum zoom, 0 is unlimitedpublic void setMaximumZoom(int zoom)
zoom - maximum zoom, 0 is unlimitedpublic void addMarker(double longitude,
double latitude,
java.lang.String styleName,
java.lang.String htmlInfo)
longitude - - longitude of markerlatitude - - latitude of markerstyleName - - name of style for marker (set via setStyle)htmlInfo - - html info for marker (info window)public void addMarker(GoogleMapMarker marker)
marker - - GoogleMapMarker to add to mappublic void addPolyline(java.lang.String lineColor,
XyPolyline polyline,
int lineWidth,
double lineOpacity)
lineColor - - Hexadecimal color of linepolyline - - XyPolyline of linelineWidth - - width of linelineOpacity - - opacity of line (0-1) or (0-100 if > 1)public void addPolyline(GoogleMapPolyline line)
line - - GoogleMapPolyline to addpublic void addPolygon(java.lang.String lineColor,
XyPolyline line,
int lineWidth,
double lineOpacity,
java.lang.String fillColor,
double fillOpacity)
lineColor - - Hexadecimal outline colorline - - XyPolyline describing outlinelineWidth - - width of linelineOpacity - - opacity of outline (0-1 or 0-100 if > 1)fillColor - - Hexadecimal fill colorfillOpacity - - opacity of fill (0-1 or 0-100 if > 1)public void addPolygon(GoogleMapPolygon polygon)
polygon - - GoogleMapPolygon to addpublic void setHtmlRefresh(int htmlRefreshInSeconds)
htmlRefreshInSeconds - - Refresh rate for html in seconds