|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.partnersoft.formats.xml.XmlBuilder
com.partnersoft.formats.xml.HtmlBuilder
com.partnersoft.formats.google.GoogleMapWriter
public class GoogleMapWriter
A writer for creating both html and javascript for a google map page. All method calls result in direct output to output stream.
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.
| Field Summary | |
|---|---|
static java.lang.String |
DOCTYPE
|
static java.lang.String |
GOOGLESOURCE
|
static java.lang.String |
XMLNS
|
| Fields inherited from class com.partnersoft.formats.xml.HtmlBuilder |
|---|
embeddedcss |
| Constructor Summary | |
|---|---|
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. |
|
| Method Summary | |
|---|---|
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()
|
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)
|
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. |
| Methods inherited from class com.partnersoft.formats.xml.HtmlBuilder |
|---|
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, writeStackTrace |
| Methods inherited from class com.partnersoft.formats.xml.XmlBuilder |
|---|
beginStartTag, close, endElement, endElement, endElement, endElement, endStartTag, isDroppingElementsWithoutContent, isEmptyingElementsWithoutContent, setDroppingElementsWithoutContent, setEmptyingElementsWithoutContent, startElement, startElement, startElement, writeAttribute, writeContent, writeContent, writeElement, writeElement, writeElement, writeEmptyElement, writeIterableContent, writeRaw |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String DOCTYPE
public static final java.lang.String XMLNS
public static final java.lang.String GOOGLESOURCE
| Constructor Detail |
|---|
public GoogleMapWriter(java.io.OutputStream out)
throws java.io.IOException
out - - where to write.
java.io.IOException
public GoogleMapWriter(java.io.Writer writer)
throws java.io.IOException
writer - - Where to write.
java.io.IOException
public GoogleMapWriter(VfsFile dest)
throws java.io.IOException
dest - - where to write.
java.io.IOException| Method Detail |
|---|
public 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.IOException
public void writeGoogleKey(java.lang.String googleKey)
throws java.io.IOException
googleKey -
java.io.IOException
public void startBody()
throws java.io.IOException
java.io.IOException
public void startBody(java.lang.String hexBgColor)
throws java.io.IOException
hexBgColor -
java.io.IOException
public void endBody()
throws java.io.IOException
java.io.IOException
public void createMap(java.lang.String mapName)
throws java.io.IOException
mapName - - id of map in html.
java.io.IOException
public void createMap()
throws java.io.IOException
java.io.IOException
public void setMapOption(GoogleMapLib.MapOptions option,
boolean isEnabled)
throws java.io.IOException
option - isEnabled -
java.io.IOException
public 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 -
java.io.IOException
public void setMapCenter(double longitude,
double latitude,
int zoom)
throws java.io.IOException
longitude - latitude -
java.io.IOException
public void setZoom(int zoom)
throws java.io.IOException
java.io.IOException
public void addIcon(java.lang.String iconName,
java.lang.String iconUrl)
throws java.io.IOException
iconName - - var name.iconUrl - - icon url.
java.io.IOException
public void addMarker(GoogleMapMarker marker)
throws java.io.IOException
marker -
java.io.IOException
public void addPolygon(GoogleMapPolygon polygon)
throws java.io.IOException
polygon -
java.io.IOException
public void addPolyline(GoogleMapPolyline polyline)
throws java.io.IOException
polyline -
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||