public class GoogleMapWriter extends HtmlBuilder
See also com.partnersoft.formats.google.GoogleMapBuilder.
Note, the order items are added to the GMap2 object will have an affect on the page. It seems controls must be added after all items have been overlaid, and no methods can be called on the map object until setCenter has been called.
Reference at: http://code.google.com/apis/maps/documentation/
Copyright 2009 Partner Software, Inc.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DOCTYPE
Standard html doctype
|
static java.lang.String |
GOOGLESOURCE
URL pointing to Google source for java script.
|
static java.lang.String |
XMLNS
Standard XML namespace
|
embeddedcssdroppingElementsWithoutContent, emptyingElementsWithoutContent, indention, indentSpace, outie, stack| Constructor and Description |
|---|
GoogleMapWriter(java.io.OutputStream out)
Creates a new GoogleMapWriter outputting to the passed stream.
|
GoogleMapWriter(VfsFile dest)
Creates a new GoogleMapWriter outputting to the passed writer.
|
GoogleMapWriter(java.io.Writer writer)
Creates a new GoogleMapWriter outputting to the passed writer.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addIcon(java.lang.String iconName,
java.lang.String iconUrl)
Defines a new GIcon to be used later.
|
void |
addMapControls(java.util.List<GoogleMapLib.MapComponents> components)
Adds all passed MapComponents to the GMap2 object in javascript.
|
void |
addMarker(GoogleMapMarker marker)
Adds a new GMarker to the map.
|
void |
addPolygon(GoogleMapPolygon polygon)
Adds a new GPolygon to the map.
|
void |
addPolyline(GoogleMapPolyline polyline)
Adds a new GPolyline to the map.
|
void |
createMap()
Creates Google Map (GMap2 javascript) object with document id 'map'.
|
void |
createMap(java.lang.String mapName)
Creates Google Map object (GMap2 javascript) with using passed
document id.
|
void |
endBody()
Closes body tag
|
void |
setMapCenter(double longitude,
double latitude,
int zoom)
Sets center of map.
|
void |
setMapOption(GoogleMapLib.MapOptions option,
boolean isEnabled)
Writes javascript for enabling or disabling the passed Google Map Option.
|
void |
setZoom(int zoom)
Sets initial zoom.
|
void |
startBody()
Writes a body tag with onload, onunload properties set.
|
void |
startBody(java.lang.String hexBgColor)
Writes a body tag with onload, onunload, and bgcolor
properties set.
|
void |
startDocument(java.lang.Object documentName)
Sets up intial html tags for GoogleMap generation.
|
void |
writeGoogleKey(java.lang.String googleKey)
Writes Script tag containing GoogleMap key.
|
endBulletedList, endDocument, endListItem, endNumberedList, endTable, endTableData, endTableRow, h1, h2, h3, h4, h5, hr, p, startBulletedList, startListItem, startNumberedList, startTable, startTableData, startTableRow, tableContents, tableHeader, writeBulletedList, writeLink, writeListItem, writeMapAsTable, writeParagraph, writeStackTracebeginStartTag, close, endElement, endElement, endElement, endElement, endStartTag, indent, isDroppingElementsWithoutContent, isEmptyingElementsWithoutContent, newLine, setDroppingElementsWithoutContent, setEmptyingElementsWithoutContent, startElement, startElement, startElement, startElement, undent, writeAttribute, writeContent, writeContent, writeElement, writeElement, writeElement, writeEmptyElement, writeEmptyElement, writeIterableContent, writeRawpublic static final java.lang.String DOCTYPE
public static final java.lang.String XMLNS
public static final java.lang.String GOOGLESOURCE
public GoogleMapWriter(java.io.OutputStream out)
throws java.io.IOException
out - - where to write.java.io.IOException - - if a problem occurs creating writers on passed OutputStreampublic GoogleMapWriter(java.io.Writer writer)
throws java.io.IOException
writer - - Where to write.java.io.IOException - - if problem occurs interacting with Writerpublic GoogleMapWriter(VfsFile dest) throws java.io.IOException
dest - - where to write.java.io.IOException - - If a problem occurs during writepublic void startDocument(java.lang.Object documentName)
throws java.io.IOException
Sets doctype. Opens html and sets xmlns. Sets head and sets meta (content-type) Sets title.
End result, unclosed html tag with unclosed head tag.
startDocument in class HtmlBuilderjava.io.IOExceptionpublic void writeGoogleKey(java.lang.String googleKey)
throws java.io.IOException
googleKey - - Key generated by Google for domainjava.io.IOException - - If a problem occurs during writepublic void startBody()
throws java.io.IOException
java.io.IOException - - If a problem occurs during writepublic void startBody(java.lang.String hexBgColor)
throws java.io.IOException
hexBgColor - - Hexadecimal background color to be used for body. Does not need quotes.java.io.IOException - - If a problem occurs during writepublic void endBody()
throws java.io.IOException
java.io.IOException - - If a problem occurs during writepublic void createMap(java.lang.String mapName)
throws java.io.IOException
mapName - - id of map in html.java.io.IOException - - If a problem occurs during writepublic void createMap()
throws java.io.IOException
java.io.IOException - - If a problem occurs during writepublic void setMapOption(GoogleMapLib.MapOptions option, boolean isEnabled) throws java.io.IOException
option - - GoogleMapLib.MapOptions to alterisEnabled - - true if passed option should be enabled, false for disabled.java.io.IOException - - If a problem occurs during writepublic void addMapControls(java.util.List<GoogleMapLib.MapComponents> components) throws java.io.IOException
Default map controls are LARGE_MAP_CONTROL and MAP_TYPE_CONTROL Controls must be added after any overlays are added.
components - - List of map components to addjava.io.IOException - - If a problem occurs during writepublic void setMapCenter(double longitude,
double latitude,
int zoom)
throws java.io.IOException
longitude - - initial longitude of centerlatitude - - initial latitude of centerzoom - - initial zoomjava.io.IOException - - If a problem occurs during writepublic void setZoom(int zoom)
throws java.io.IOException
zoom - - initial zoom leveljava.io.IOException - - If a problem occurs during writepublic void addIcon(java.lang.String iconName,
java.lang.String iconUrl)
throws java.io.IOException
iconName - - var name.iconUrl - - icon url.java.io.IOException - - If a problem occurs during writepublic void addMarker(GoogleMapMarker marker) throws java.io.IOException
marker - - GoogleMapMarker to add to mapjava.io.IOException - - If a problem occurs during writepublic void addPolygon(GoogleMapPolygon polygon) throws java.io.IOException
polygon - - GoogleMapPolygon to add to mapjava.io.IOException - - If a problem occurs during writepublic void addPolyline(GoogleMapPolyline polyline) throws java.io.IOException
polyline - - GoogleMapPolyline to add to mapjava.io.IOException - - If a problem occurs during write