com.esri.aims.mtier.model.map
Class Map

java.lang.Object
  extended by com.esri.aims.mtier.model.map.Map
All Implemented Interfaces:
Serializable

public class Map
extends Object
implements Serializable

Represents the map to be displayed. This object is the entry point into the ArcIMS Java Connector object model.

See Also:
Serialized Form

Field Summary
 String ArcIMSApplicationServerVersion
           
static long EAST
           
static int GET_EXTRACT
           
static int GET_FEATURE
           
static int GET_GEOCODE
           
static int GET_IMAGE
           
static int GET_RASTER_INFO
           
static long NORTH
           
static long NORTHEAST
           
static long NORTHWEST
           
static long SOUTH
           
static long SOUTHEAST
           
static long SOUTHWEST
           
static String TOC_IMAGE_FORMAT_JPG
           
static String TOC_IMAGE_FORMAT_PNG
           
static long WEST
           
 
Constructor Summary
Map()
          Constructs an instance of a Map object.
 
Method Summary
 void addWorkspace(Object workspace)
          Associates a workspace object to this Map to prepare to dynamically add a layer.
 void centerAt(double x, double y)
          Centers the Map extents based on x and y pixel coordinates.
 void clearBuffer()
          Removes the Buffer Layer and Buffer Region layer from the layer collection.
 void clearWorkspaces()
          Removes all workspace objects associated with the Map object.
 void createBufferImage(boolean createImage, boolean bufferRegion)
          Specifies the creation of the bufferimage to be displayed on a map.
 void displayFeatures(FeatureLayer targetLayer, boolean zoomToFeatures, Object symbolObject)
          Highlights and zooms specific features on the map, based on the spatial object and filter set in feature layer.
 void displayFeatures(FeatureLayer targetLayer, Object spatialObject, boolean zoomToFeatures, Object symbolObject)
          Deprecated. As of ArcIMS 4.0.1 Java Connector, replaced by displayFeatures(FeatureLayer targetLayer, Shape spatialObject, boolean zoomToFeatures, Object symbolObject).
 void displayFeatures(FeatureLayer targetLayer, Shape spatialObject, boolean zoomToFeatures, Object symbolObject)
          Highlights and zooms specific features on the map, based on the spatial object.
 void displayFeatures(FeatureLayer targetLayer, String expression, boolean zoomToFeatures, Object symbolObject)
          Highlights and zooms to specific features on the map, based on a where expression.
 void doPan(long direction, double step)
          Deprecated. As of ArcIMS 4.0.1 Java Connector, replaced by doPan(long,long).
 void doPan(long direction, long step)
          Pans the specified map service by recalculating the Map objects envelope object.
 void doZoom(long scaleFactor)
          Zooms to a new location of the specified map service by recalculating the Map objects extent.
 void doZoomToExtent(Envelope obj)
          Resets the Map objects extent by reassigning the extent to a new Envelope object.
 void doZoomToFullExtent()
          Zooms to the Map objects initial extent envelope.
 Point fromMapPoint(double x, double y)
          Converts from database coordinate to pixel coordinate values.
 String getArcXML()
          Returns a ArcXML String that will be built if a refresh() is called at that instance.
 String getBackground()
          Returns the Map's background color value in RGB format.
 Capabilities getCapabilities()
          Returns the list any restrictions for an ArcIMS service.
 ConnectionProxy getConnectionProxy()
          Returns the ConnectionProxy object associated with this map object.
 String getDataFrameName()
          Returns the name of the dataframe associated with this map object.
 long getDPI()
          Returns the DPI(dots per square inch) for the output image.
 Envelope getEnvelope()
          Returns the Envelope associated with this Map object.
 String getErrorMessage()
          Returns the error message if there is any error in ArcXML response.
 FeatureCoordSys getFeatureCoordSys()
          Returns the FeatureCoordSys associated with this Map object.
 FilterCoordSys getFilterCoordSys()
          Returns the FilterCoordSys object associated with this Map object.
 long getHeight()
          Returns the Map's height value in pixels.
 ImageLimit getImageLimit()
          Returns the ImageLimit object associated with this Map object.
 FeatureCoordSys getInitialFeatureCoordSys()
          Returns the FeatureCoordSys associated with this Map object.
 FilterCoordSys getIntialFilterCoordSys()
          Returns the FilterCoordSys object associated with this Map object.
 Layers getLayers()
          Returns the Layers collection associated with this Map object.
 Legend getLegend()
          Returns the Legend associated with this Map object.
 Locale getLocale()
          Returns the Locale object associated with this Map object.
 MapOutput getMapOutput()
          Returns the Output object associated with this Map object.
 String getMapUnits()
          Returns the map units associated with this Map object.
 int getPatchWidth()
           
 long getPrintHeight()
          Returns the height of the output image in pixels.
 long getPrintWidth()
          Returns the width of the output image in pixels.
 Scale getScale()
          Returns Scale associated with a dataframe.
 Separators getSeparators()
          Returns the Separators object associated with this Map object.
 InputStream getServiceInfo()
          Return the response information from ArcXML request GET_SERVICE_INFO as a InputStream
 String getShow()
           
 byte[] getStream()
          Returns map image in raw bytes.
 String getStreamType()
          Returns the file type of streamed map raw bytes.
 String getSwatchBackgroundColor()
           
 int getSwatchHeight()
           
 String getTOCImageFormat()
           
 String getTransColor()
          Returns the Map objects transparency color property value in RGB format.
 UIFont getUIFont()
          Returns the UIFont object associated with this Map object.
 long getWidth()
          Returns the Map's width value in pixels.
 Object getWorkspace(int item)
          Returns a workspace object by index.
 int getWorkspaceCount()
          Returns the number of workspace objects associated with the Map.
 void initMap(ConnectionProxy connection, long dpi, boolean loadEnvelope, boolean loadRenderer, boolean loadFields, boolean loadExtensions)
          Initializes a Map object for a certain map service based on the ConnectionProxy.
 void initMap(ConnectionProxy connection, long dpi, boolean loadEnvelope, boolean loadRenderer, boolean loadFields, boolean loadExtensions, boolean loadAcetateInfo, boolean loadRelativeScale)
          Initializes a Map object for a certain map service based on the ConnectionProxy.
 boolean isAutoResize()
          Returns autoresize associated with a Map.
 boolean isBufferRegion()
          Returns true if the bufferRegion argument within the createBufferImage method was set to true.
 boolean isCreateBufferImage()
          Returns true if the argument within the createBufferImage method is set to true.
 boolean isExtract()
          Returns true if the Map object's setExtract method is set to true.
 boolean isReturnScale()
           
 boolean isScaleSymbols()
          Returns true if the setScaleSymbols method is set to true.
 boolean isShowSwatches()
           
 boolean isUseServiceDatum()
           
 void refresh()
          Refreshes the current map service.
 void removeWorkspace(int item)
          Removes an associated workspace object from the Map object.
 void reset()
          Resets the model to its original state that existed after the initMap method was called.
 String sendArcXML(String axlString, int requestType)
          Sends the ArcXML string to the server based on the request type.
 Recordset sendGetFeatureRequest(FeatureLayer queryLayer)
          Sends the GET_FEATURES request to the server based on the specified Feature layer.
 void sendImageRequest()
          Set this method to send an Image request with Filter.
 void setAutoResize(boolean value)
          Sets Map autoresize.
 void setBackground(String color)
          Sets the Map's background color value in RGB format.
 void setConnectionProxy(ConnectionProxy obj)
          Sets the ConnectionProxy object associated with this map object.
 void setDataFrameName(String value)
          If the associated ArcIMS service is an ArcMap service, this method sets the name of the dataframe to the map object.
 void setDPI(long value)
          Sets the DPI(dots per square inch) for the output image.
 void setEnvelope(Envelope obj)
          Sets the map extent based on the given envelope object.
 void setExtract(boolean value)
          Enables a GET_EXTRACT request.
 void setFeatureCoordSys(FeatureCoordSys obj)
          Associates the given FeatureCoordSys object with the Map Object.
 void setFilterCoordSys(FilterCoordSys obj)
          Associates a FilterCoordSys object to the Map Object.
 void setHeight(long height)
          Sets the Map's height value in pixels.
 void setMapUnits(String value)
          Sets the given map units for this Map object.
 void setPrintHeight(long value)
          Sets the height of the output image in pixels.
 void setPrintWidth(long value)
          Sets the width of the output image in pixels.
 void setReturnScale(boolean returnScale)
           
 void setScale(Scale obj)
          Sets Scale for a dataframe.
 void setScaleSymbols(boolean value)
          Set Map's scalesymbols.
 void setServiceInfo(InputStream serviceInfo)
          Set the information from ArcXML request GET_SERVICE_INFO as a InputStream
 void setShow(String show)
           
 void setShowSwatches(boolean swatches)
           
 void setStream(byte[] stream)
          Sets map image raw bytes.
 void setStreamType(String type)
          Sets file type of the streamed image raw bytes.
 void setSwatchBackgroundColor(String color)
           
 void setSwatchHeight(int height)
           
 void setSwatchWidth(int width)
           
 void setTOCImageFormat(String imageFormat)
           
 void setTransColor(String color)
          Sets the Map's transparency color property in RGB format.
 void setUseServiceDatum(boolean useServiceDatum)
           
 void setWidth(long width)
          Sets the Map objects width value in pixels.
 Point toMapPoint(double x, double y)
          Converts from pixel coordinate values to database coordinate values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ArcIMSApplicationServerVersion

public String ArcIMSApplicationServerVersion

NORTH

public static final long NORTH
See Also:
Constant Field Values

NORTHEAST

public static final long NORTHEAST
See Also:
Constant Field Values

EAST

public static final long EAST
See Also:
Constant Field Values

SOUTHEAST

public static final long SOUTHEAST
See Also:
Constant Field Values

SOUTH

public static final long SOUTH
See Also:
Constant Field Values

SOUTHWEST

public static final long SOUTHWEST
See Also:
Constant Field Values

WEST

public static final long WEST
See Also:
Constant Field Values

NORTHWEST

public static final long NORTHWEST
See Also:
Constant Field Values

GET_IMAGE

public static final int GET_IMAGE
See Also:
Constant Field Values

GET_FEATURE

public static final int GET_FEATURE
See Also:
Constant Field Values

GET_GEOCODE

public static final int GET_GEOCODE
See Also:
Constant Field Values

GET_EXTRACT

public static final int GET_EXTRACT
See Also:
Constant Field Values

GET_RASTER_INFO

public static final int GET_RASTER_INFO
See Also:
Constant Field Values

TOC_IMAGE_FORMAT_JPG

public static final String TOC_IMAGE_FORMAT_JPG
See Also:
Constant Field Values

TOC_IMAGE_FORMAT_PNG

public static final String TOC_IMAGE_FORMAT_PNG
See Also:
Constant Field Values
Constructor Detail

Map

public Map()
Constructs an instance of a Map object. The Map object contains all parameters needed to display and function as a map. Example:
Map map = new Map();

Method Detail

initMap

public void initMap(ConnectionProxy connection,
                    long dpi,
                    boolean loadEnvelope,
                    boolean loadRenderer,
                    boolean loadFields,
                    boolean loadExtensions)
             throws Exception
Initializes a Map object for a certain map service based on the ConnectionProxy. This method sends a GET_SERVICE_INFO request to the server. The parameters determine the values of the attributes in the GET_SERVICE_INFO element. Please refer to ArcXML Programmer's Reference Guide for more information. Example:
map.initMap(connectionProxy, 0, true, true, true, true);

Parameters:
connection - the ConnectionProxy Object.
dpi - Dots per inch (dpi). Used for calculating the correct scale thresholds for layers in the service. The dpi must be calculated by the client. If set to 0, a value of 96 is assumed. This parameter sets the value of attribute "dpi" in GET_SERVICE_INFO element.
loadEnvelope - Whether to get information on the envelope for featureclass layers in a service. Featureclass layers include shapefile and ArcSDE layers. This parameter sets the value of attribute "envelope" in GET_SERVICE_INFO element.
loadRenderer - Whether to get renderer information for featureclass layers in a service. This parameter sets the value of attribute "renderer" in GET_SERVICE_INFO element.
loadFields - Whether to get information on available fields for each featureclass layer in the service. This parameter sets the value of attribute "fields" in GET_SERVICE_INFO element.
loadExtensions - When set to true and a featureclass layer has EXTENSION elements, e.g. for extract or geocode, in the .axl configuration file, information about these EXTENSION elements will be included in the ArcXML response. This parameter sets the value of attribute "extensions" in GET_SERVICE_INFO element.
Throws:
Exception

initMap

public void initMap(ConnectionProxy connection,
                    long dpi,
                    boolean loadEnvelope,
                    boolean loadRenderer,
                    boolean loadFields,
                    boolean loadExtensions,
                    boolean loadAcetateInfo,
                    boolean loadRelativeScale)
             throws Exception
Initializes a Map object for a certain map service based on the ConnectionProxy. This method sends a GET_SERVICE_INFO request to the server. The parameters determine the values of the attributes in the GET_SERVICE_INFO element. Please refer to ArcXML Programmer's Reference Guide for more information. Example:
map.initMap(connectionProxy, 0, true, true, true, true);

Parameters:
connection - the ConnectionProxy Object.
dpi - Dots per inch (dpi). Used for calculating the correct scale thresholds for layers in the service. The dpi must be calculated by the client. If set to 0, a value of 96 is assumed. This parameter sets the value of attribute "dpi" in GET_SERVICE_INFO element.
loadEnvelope - Whether to get information on the envelope for featureclass layers in a service. Featureclass layers include shapefile and ArcSDE layers. This parameter sets the value of attribute "envelope" in GET_SERVICE_INFO element.
loadRenderer - Whether to get renderer information for featureclass layers in a service. This parameter sets the value of attribute "renderer" in GET_SERVICE_INFO element.
loadFields - Whether to get information on available fields for each featureclass layer in the service. This parameter sets the value of attribute "fields" in GET_SERVICE_INFO element.
loadExtensions - When set to true and a featureclass layer has EXTENSION elements, e.g. for extract or geocode, in the .axl configuration file, information about these EXTENSION elements will be included in the ArcXML response. This parameter sets the value of attribute "extensions" in GET_SERVICE_INFO element.
loadAcetateInfo - Whether to include all symbol information and geometry from an acetate layer.
loadRelativeScale - Whether to return scale in relative or not for layer and scale dependent renderer.
Throws:
Exception

setWidth

public void setWidth(long width)
Sets the Map objects width value in pixels. Example:
map.setWidth(400);

Parameters:
width - the width value.
See Also:
getWidth()

setHeight

public void setHeight(long height)
Sets the Map's height value in pixels. Example:
map.setHeight(350);

Parameters:
height - the height value.
See Also:
getHeight()

getWidth

public long getWidth()
Returns the Map's width value in pixels. Example:
long width = map.getWidth();

Returns:
long
See Also:
setWidth(long)

getHeight

public long getHeight()
Returns the Map's height value in pixels. Example:
long height = map.getHeight();

Returns:
long
See Also:
setHeight(long)

sendImageRequest

public void sendImageRequest()
Set this method to send an Image request with Filter.
map.sendImageRequest();
When there is a filter applied to any FeatureLayer in the Map object, calling map.refresh() will send a GET_FEATURES request with the Filter. To force the Java Connector to send a GET_IMAGE request, call this method.

Following code will only send a GET_FEATURES request:


  featureLayer.setFilterObject(filter);
  map.refresh();

Following code will only send a GET_IMAGE request:

  featureLayer.setFilterObject(filter);
  map.sendImageRequest();
  map.refresh();

Following code will send both GET_FEATURES and GET_IMAGE requests:

  featureLayer.setFilterObject(filter);
  map.refresh();
  map.sendImageRequest();
  map.refresh();

The Filter information will be applied to the FeatureLayer, so only features that satisfy the Filter criteria will be drawn on the layer in the returned map. Unlike displayFeatures, which creates an extra layer for the Filter information, this method applies the Filter information on the original FeatureLayer.
When the Filter object has included a Buffer object, the better choice to force Java Connector to send a GET_IMAGE request is to call method createBufferImage(boolean, boolean).


setPrintHeight

public void setPrintHeight(long value)
Sets the height of the output image in pixels. Example:
map.setPrintHeight(400);

Parameters:
value - the pixel value.
See Also:
getPrintHeight()

setPrintWidth

public void setPrintWidth(long value)
Sets the width of the output image in pixels. Example:
map.setPrintWidth(400);

Parameters:
value - the pixel value.
See Also:
getPrintWidth()

getPrintHeight

public long getPrintHeight()
Returns the height of the output image in pixels. Example:
long printHeight = map.getPrintHeight();

Returns:
long
See Also:
setPrintHeight(long)

getPrintWidth

public long getPrintWidth()
Returns the width of the output image in pixels. Example:
long printWidth = map.getPrintWidth();

Returns:
long
See Also:
setPrintWidth(long)

setScaleSymbols

public void setScaleSymbols(boolean value)
Set Map's scalesymbols. Map's scalesymbols sets the value of attribute "scalesymbols" in IMAGESIZE element in an ArcXML request. Please refer to ArcXML Programmer's Reference Guide for more information.

Parameters:
value - Default value is false.
See Also:
isScaleSymbols()

isScaleSymbols

public boolean isScaleSymbols()
Returns true if the setScaleSymbols method is set to true. Example:
boolean scaleSymbols = map.isScaleSymbols();

Returns:
boolean
See Also:
setScaleSymbols(boolean)

setDPI

public void setDPI(long value)
Sets the DPI(dots per square inch) for the output image. Example:
map.setDPI(200);

Parameters:
value - the DPI value.
See Also:
getDPI()

getDPI

public long getDPI()
Returns the DPI(dots per square inch) for the output image. Example:
long dpi = map.getDPI();

Returns:
long
See Also:
setDPI(long)

setAutoResize

public void setAutoResize(boolean value)
Sets Map autoresize. Map autoresize sets the value of attribute "autoresize" in GET_IMAGE element in an ArcXML request. Please refer to ArcXML Programmer's Reference Guide for more information.

Parameters:
value - Default is false.
See Also:
isAutoResize()

isAutoResize

public boolean isAutoResize()
Returns autoresize associated with a Map.

See Also:
setAutoResize(boolean)

setBackground

public void setBackground(String color)
Sets the Map's background color value in RGB format. The Map's background color sets the value of attribute "color" in BACKGROUND element in an ArcXML request. Please refer to ArcXML Programmer's Reference Guide for more information. Example:
map.setBackground("255,0,0");

Parameters:
color - the color value.
See Also:
getBackground()

getBackground

public String getBackground()
Returns the Map's background color value in RGB format. Example:
String color = map.getBackground();

Returns:
String
See Also:
setBackground(java.lang.String)

setTransColor

public void setTransColor(String color)
Sets the Map's transparency color property in RGB format. The Map's transparency color sets the value of attribute "transcolor" in BACKGROUND element in an ArcXML request. Please refer to ArcXML Programmer's Reference Guide for more information. If you need to create an image with a transparent background, use the same color for map's background and transcolor properties, for example:

    map.setBackground("255,255,255");
    map.setTransColor("255,255,255");
 

Parameters:
color - the color value.
See Also:
getTransColor()

getTransColor

public String getTransColor()
Returns the Map objects transparency color property value in RGB format. Example:
String transcolor = map.getTransColor();

Returns:
String
See Also:
setTransColor(java.lang.String)

centerAt

public void centerAt(double x,
                     double y)
Centers the Map extents based on x and y pixel coordinates. Example:
map.centerAt(255.0, 155.0);

Parameters:
x - is passed as double
y - is passed as double
See Also:
doZoom(long), doPan(long, double)

getLegend

public Legend getLegend()
Returns the Legend associated with this Map object. Example:
Legend legend = map.getLegend();

Returns:
Legend

toMapPoint

public Point toMapPoint(double x,
                        double y)
Converts from pixel coordinate values to database coordinate values. Example:
PointObject pnt = map.toMapPoint(100, 100);

Parameters:
x - the x coordinate.
y - the y coordinate.
Returns:
Point
See Also:
fromMapPoint(double, double)

fromMapPoint

public Point fromMapPoint(double x,
                          double y)
Converts from database coordinate to pixel coordinate values. Example:
PointObject pnt = map.fromMapPoint(-125.00, 45.0);

Parameters:
x - the x coordinate value.
y - the y coordinate value.
Returns:
Point

doZoom

public void doZoom(long scaleFactor)
Zooms to a new location of the specified map service by recalculating the Map objects extent. Example:
map.doZoom(2);

Parameters:
scaleFactor - the scale factor value.
See Also:
doPan(long, double), centerAt(double, double)

displayFeatures

public void displayFeatures(FeatureLayer targetLayer,
                            Object spatialObject,
                            boolean zoomToFeatures,
                            Object symbolObject)
Deprecated. As of ArcIMS 4.0.1 Java Connector, replaced by displayFeatures(FeatureLayer targetLayer, Shape spatialObject, boolean zoomToFeatures, Object symbolObject).

Highlights and zooms specific features on the map, based on the spatial object. Example:
map.displayFeatures(featureLayer, envelope, true, simpleMarkerSymbol);
See displayFeatures(FeatureLayer, boolean, Object) for more information.

Parameters:
targetLayer - the FeatureLayer to query for feature.
spatialObject - the the spatial object to perform the spatial query against.
zoomToFeatures - specifies whether to zoom to selected features.
symbolObject - the symbol object to assign to the highlighted feature.
See Also:
doPan(long, double), doPan(long, double), doZoomToExtent(com.esri.aims.mtier.model.envelope.Envelope), doZoomToFullExtent()

displayFeatures

public void displayFeatures(FeatureLayer targetLayer,
                            Shape spatialObject,
                            boolean zoomToFeatures,
                            Object symbolObject)
Highlights and zooms specific features on the map, based on the spatial object. Example:
map.displayFeatures(featureLayer, envelope, true, simpleMarkerSymbol);
See displayFeatures(FeatureLayer, boolean, Object) for more information.

Parameters:
targetLayer - the FeatureLayer to query for feature.
spatialObject - the the spatial object to perform the spatial query against.
zoomToFeatures - specifies whether to zoom to selected features.
symbolObject - the symbol object to assign to the highlighted feature.
See Also:
doPan(long, double), doPan(long, double), doZoomToExtent(com.esri.aims.mtier.model.envelope.Envelope), doZoomToFullExtent()

displayFeatures

public void displayFeatures(FeatureLayer targetLayer,
                            boolean zoomToFeatures,
                            Object symbolObject)
Highlights and zooms specific features on the map, based on the spatial object and filter set in feature layer. Example:
map.displayFeatures(featureLayer, true, simpleMarkerSymbol);

First, displayFeatures() gets a Filter object either already applied to the featureLayer (displayFeatures(FeatureLayer, boolean, Object)) or builds a Filter object from the where expression ( displayFeatures(FeatureLayer, String, boolean, Object) or the spatial object ( displayFeatures(FeatureLayer, Shape, boolean, Object)). Second, If the boolean zoomToFeatures is true, the Filter is applied to the featureLayer and a GET_FEATURES request with the Filter information is sent. The returned records are applied to the Recordset property of the featureLayer, and the map will zoom to the global envelope of these records. If zoomToFeatures is false, this step is skipped. Third, a highlight layer is added to the Map object, the highlight layer is based on the featureLayer, and the Filter object from first step is applied to the highlight layer, so only features satisfying the Filter will be displayed on the highlight layer. The highlight layer's name is always "HighlightLayer".
Notes:
1. The highlight layer created by the displayFeatures() method will interfer with Filter object applied later. If you call displayfeatures(), then setFilterObject(), either on the same featureLayer or another layer, no request will be sent. To workaround, remove the highlight layer before calling setFilterObject(). KB article 23314 discusses this problem.
2. If zoomToFeatures is true and the features selected are ONLY ONE point, the returned map is empty. The reason is that Java Connector zooms to the envelope of the features selected, but in the case where only one point feature is selected the envelope will itself represent a point and no image will be generated. The workaround is that after calling the displayFeatures method, build a small envelope around the point and zoom to this envelope. KB article 26341 has full sample code.
3. Another known problem for this method is that when two displayFeatures calls are made on two different layers, the first layer has the selected features highlighted correctly, but the rest of the features in the first layer are not displayed. The second layer displays properly. If calling this method multiple times on the same layer, there is no such problem.

Parameters:
targetLayer - the FeatureLayer to query for feature.
zoomToFeatures - specifies whether to zoom to selected features.
symbolObject - the symbol object to assign to the highlighted feature.
See Also:
doPan(long, double), doPan(long, double), doZoomToExtent(com.esri.aims.mtier.model.envelope.Envelope), doZoomToFullExtent()

displayFeatures

public void displayFeatures(FeatureLayer targetLayer,
                            String expression,
                            boolean zoomToFeatures,
                            Object symbolObject)
Highlights and zooms to specific features on the map, based on a where expression. Example:
map.displayFeatures(featureLayer, "Name='Scofield'", true, simpleMarkerSymbol);
See displayFeatures(FeatureLayer, boolean, Object) for more information.

Parameters:
targetLayer - the FeatureLayer to query for feature.
expression - the expression to query for the desired features.
zoomToFeatures - specifies whether to zoom to selected features.
symbolObject - the symbol object to assign to the highlighted feature.
See Also:
doPan(long, double), doPan(long, double), doZoomToExtent(com.esri.aims.mtier.model.envelope.Envelope), doZoomToFullExtent()

doPan

public void doPan(long direction,
                  double step)
Deprecated. As of ArcIMS 4.0.1 Java Connector, replaced by doPan(long,long).

Pans the specified map service by recalculating the Map objects envelope object. Example:
map.doPan(Map.SOUTHWEST, 3); 

Parameters:
direction - the directional constant value.
step - the amount of directional shift.
See Also:
doZoom(long), centerAt(double, double)

doPan

public void doPan(long direction,
                  long step)
Pans the specified map service by recalculating the Map objects envelope object. Example:
map.doPan(Map.SOUTHWEST, 3); 

Parameters:
direction - the directional constant value.
step - the amount of directional shift.
See Also:
doZoom(long), centerAt(double, double)

doZoomToExtent

public void doZoomToExtent(Envelope obj)
Resets the Map objects extent by reassigning the extent to a new Envelope object. Example:
map.doZoomToExtent(envelope);

Parameters:
obj - the Envelope object.

doZoomToFullExtent

public void doZoomToFullExtent()
Zooms to the Map objects initial extent envelope. Example:
map.doZoomToFullExtent();

See Also:
doPan(long, double), doZoom(long), centerAt(double, double)

refresh

public void refresh()
Refreshes the current map service. Requests sent to the map service are based on the current status of the model, generally a GET_IMAGE request will be sent. Here are some general rules on what request will be sent:
1. When map.setExtract(true) is called, the request is GET_EXTRACT.
2. When map.sendImageRequest() is called, the request is GET_IMAGE.
3. If dynamic layers with Workspace are added to the map, and map.getWorkspaceCount()>0, the request is GET_IMAGE. Please see KB article 26364 for more information on its impact on the following Filter operation.
4. If a Filter is applied to a FeatureLayer, usually a GET_FEATURES request will be sent; if map.createBufferImage(true,true/false) is called, both GET_FEATURES and GET_IMAGE requests will be sent. See map.createBufferImage() for more information.
5. If a FeatureLayer is geocodable, and its AddressMatchInputs property has been assigned values, then a GET_GEOCODE request will be sent.
6. If for a ImageLayer, its RasterObject has been assigned with,
   ImageLayer.setRasterObject()
   then the request will be GET_RASTER_INFO.
7. Use the method sendGetFeatureRequest(com.esri.aims.mtier.model.map.layer.FeatureLayer) for querying dynamic layer.

See Also:
getMapOutput()

getMapOutput

public MapOutput getMapOutput()
Returns the Output object associated with this Map object. The output object contains the information about the generated map image. Example:
MapOutput output = map.getMapOutput();

Returns:
Output
See Also:
refresh()

getLayers

public Layers getLayers()
Returns the Layers collection associated with this Map object. Example:
String type = map.getLayers().item(1).getType();

Returns:
Layers

setEnvelope

public void setEnvelope(Envelope obj)
Sets the map extent based on the given envelope object. Example:
map.setEnvelope(envelope);

Parameters:
obj - the Envelope object.
See Also:
getEnvelope()

getEnvelope

public Envelope getEnvelope()
Returns the Envelope associated with this Map object. Example:
Envelope env = map.getEnvelope();

Returns:
Envelope
See Also:
setEnvelope(com.esri.aims.mtier.model.envelope.Envelope)

setScale

public void setScale(Scale obj)
Sets Scale for a dataframe.


getScale

public Scale getScale()
Returns Scale associated with a dataframe.


setStream

public void setStream(byte[] stream)
Sets map image raw bytes.


getStream

public byte[] getStream()
Returns map image in raw bytes.


setStreamType

public void setStreamType(String type)
Sets file type of the streamed image raw bytes.


getStreamType

public String getStreamType()
Returns the file type of streamed map raw bytes.


setExtract

public void setExtract(boolean value)
Enables a GET_EXTRACT request. In order to allow GET_EXTRACT requests on an ArcIMS service, the extract EXTENSION must be included in the map configuration file with at least one layer. Please refer to ArcXML Programmer's Reference Guide for more information.

Parameters:
value - Default is false. When set to true, a GET_EXTRACT request will be sent. Only Feature layers that are visible at the current scale and FeatureLayer.setExtractable(true) is called will be extracted.
See Also:
isExtract()

isExtract

public boolean isExtract()
Returns true if the Map object's setExtract method is set to true. Example:
if(map.isExtract() == true){ map.setExtract(false);}

Returns:
boolean
See Also:
setExtract(boolean)

setFeatureCoordSys

public void setFeatureCoordSys(FeatureCoordSys obj)
Associates the given FeatureCoordSys object with the Map Object. This is used for re-projecting the Map object. The setFilterCoordSys method must also be set. Example:
map.setFeatureCoordSys(featureCoordSys);

Parameters:
obj - the FeatureCoordSys object.
See Also:
getFeatureCoordSys(), setFilterCoordSys(com.esri.aims.mtier.model.map.projection.FilterCoordSys)

getFeatureCoordSys

public FeatureCoordSys getFeatureCoordSys()
Returns the FeatureCoordSys associated with this Map object. Example:
String id = map.getFeatureCoordSys().getID();

Returns:
FeatureCoordSys
See Also:
setFeatureCoordSys(com.esri.aims.mtier.model.map.projection.FeatureCoordSys)

getInitialFeatureCoordSys

public FeatureCoordSys getInitialFeatureCoordSys()
Returns the FeatureCoordSys associated with this Map object. (Values from CONFIG file) Example:
String id = map.getIntialFeatureCoordSys().getID();

Returns:
FeatureCoordSys

setFilterCoordSys

public void setFilterCoordSys(FilterCoordSys obj)
Associates a FilterCoordSys object to the Map Object. This method is used for reprojecting the Map object. The setFeatureCoordSys method must also be set. Example:
map.setFilterCoordSys(filterCoordSys);

Parameters:
obj - the FilterCoordSys object.
See Also:
getFilterCoordSys(), setFeatureCoordSys(com.esri.aims.mtier.model.map.projection.FeatureCoordSys)

getFilterCoordSys

public FilterCoordSys getFilterCoordSys()
Returns the FilterCoordSys object associated with this Map object. Example:
String id = map.getFilterCoordSys().getID();

Returns:
FilterCoordSys
See Also:
setFilterCoordSys(com.esri.aims.mtier.model.map.projection.FilterCoordSys)

getIntialFilterCoordSys

public FilterCoordSys getIntialFilterCoordSys()
Returns the FilterCoordSys object associated with this Map object. (Values from CONFIG file) Example:
String id = map.getInitialFilterCoordSys().getID();

Returns:
FilterCoordSys

getMapUnits

public String getMapUnits()
Returns the map units associated with this Map object. The value of map units comes from the value of attribute "units" of MAPUNITS element in ArcXML response. Please refer to ArcXML Programmer's Reference Guide for more information.

Returns:
String
See Also:
setMapUnits(java.lang.String)

setMapUnits

public void setMapUnits(String value)
Sets the given map units for this Map object. Example: map.setMapUnits(Map.METERS);

Parameters:
value - the map units value.
See Also:
getMapUnits()

getSeparators

public Separators getSeparators()
Returns the Separators object associated with this Map object. The Separators object contains the tupple and coordinate separators properties. Example:
Separators separators = map.getSeparators();

Returns:
Separators
See Also:
getUIFont(), getLocale()

getUIFont

public UIFont getUIFont()
Returns the UIFont object associated with this Map object. The UIFont object contains the defaults for all requests being sent to the ArcIMS Spatial Server. Example:
UIFont uiFont = map.getUIFont();

Returns:
UIFont
See Also:
getSeparators(), getLocale()

getLocale

public Locale getLocale()
Returns the Locale object associated with this Map object. The Locale object contains the country, language, and variant information about the specified service. Example:
Locale locale = map.getLocale();

Returns:
Locale
See Also:
getSeparators(), getUIFont()

getImageLimit

public ImageLimit getImageLimit()
Returns the ImageLimit object associated with this Map object. The ImageLimit object contains the pixelcount property. The pixel count represents the maximum number of pixels allowed in a map image. Example:
ImageLimit imageLimit = map.getImageLimit();

Returns:
ImageLimit

createBufferImage

public void createBufferImage(boolean createImage,
                              boolean bufferRegion)
Specifies the creation of the bufferimage to be displayed on a map. Example:
   ...
   filter.setBufferObject(buffer);
   ...
   fLayer.setFilterObject(filter);
   ....
   map.createBufferImage(true, false);
   map.refresh();
After the Buffer and Filter objects are set to a FeatureLayer, when map.refresh() is invoked, Java Connector will usually send a GET_FEATURES request. Call this method before map.refresh() to let the Java Connector know whether to send a GET_IMAGE request too besides the GET_FEATURES request.
Note:
1. When the Buffer object is assigned to the Filter object with filter.setBufferObject(buffer), this method will take effect ONLY when buffer.setPerformBuffer(true) is called.
2. When the Buffer object is assigned to the Filter object with filter.setEnvelopeBuffer(buffer), this method does NOT take effect.

Parameters:
createImage - specifies whether to create the image of the selected features. Default value is false. When set to true, Java Connector will send a GET_IMAGE request with the buffer information. Features that fall within the buffer region as defined by the Buffer object will be drawn on a layer called "BufferLayer", which is newly created for this buffer query. The symbol of these features are set by Buffer.setBufferSelectionSymbol(Object).
bufferRegion - specifies whether to draw the buffer region on the map. This parameter only works when parameter "createImage" is set to true. Default value is false. When both "createImage" and "bufferRegion" are set to true, in the GET_IMAGE request, Java Connector will not only create a "BufferLayer" for the features falling within the buffer region, another layer "BufferRegion" is also created. This layer has the image of the buffer region as defined by the Buffer Object. The symbol of the buffer region is set by Buffer.setBufferRegionSymbol(Object)
See Also:
isCreateBufferImage(), isBufferRegion()

isCreateBufferImage

public boolean isCreateBufferImage()
Returns true if the argument within the createBufferImage method is set to true. Example:
if(map.isCreateBufferImage() == true){ map.createBufferImage(false, false);}

Returns:
boolean
See Also:
createBufferImage(boolean, boolean), isBufferRegion()

isBufferRegion

public boolean isBufferRegion()
Returns true if the bufferRegion argument within the createBufferImage method was set to true. Example:
if(map.isBufferRegion() == true){ map.createBufferImage(false, false);}

Returns:
boolean
See Also:
createBufferImage(boolean, boolean), isCreateBufferImage()

reset

public void reset()
Resets the model to its original state that existed after the initMap method was called. Example:
map.reset();

See Also:
initMap(com.esri.aims.mtier.io.ConnectionProxy, long, boolean, boolean, boolean, boolean)

addWorkspace

public void addWorkspace(Object workspace)
Associates a workspace object to this Map to prepare to dynamically add a layer. Workspaces include ShapeWorkspace, SDEWorkspace, and ImageWorkspace. Example:
     ShapeWorkspace shpw = new ShapeWorkspace();
     shpw.setDirectory("C:\\temp");
     shpw.setName("workspace1");
     map.addWorkspace(shpw);
     Dataset data = new Dataset();
     data.setName("sc_topoq24");
     data.setWorkspaceName(shpw.getName());
     data.setType("line");
     FeatureLayer fl = new FeatureLayer("topo", null, null);
     fl.setDataset(data);
     fl.setName("topoQuad");
     fl.setVisible(true);
     map.getLayers().add(fl);
     map.refresh();
All methods in class Map involving "workspace": clearWorkspaces(), getWorkspace(int), getWorkspaceCount(), removeWorkspace(int) refer to the workspace added with this method.

Parameters:
workspace - the workspace object.
See Also:
getWorkspaceCount(), getWorkspace(int), clearWorkspaces(), removeWorkspace(int)

getWorkspaceCount

public int getWorkspaceCount()
Returns the number of workspace objects associated with the Map. This only includes workspace objects that have been dynamically added by the addWorkspace method and not those configured in your *.axl file. Example:
int count = map.getWorkspaceCount();

Returns:
int
See Also:
addWorkspace(java.lang.Object), getWorkspace(int), clearWorkspaces(), removeWorkspace(int)

getWorkspace

public Object getWorkspace(int item)
Returns a workspace object by index. Example:
ShapeWorkspace sworkspace = (ShapeWorkspace)map.getWorkspace(0);

Parameters:
item - the workspace item.
Returns:
Object
See Also:
addWorkspace(java.lang.Object), getWorkspaceCount(), clearWorkspaces(), removeWorkspace(int)

clearWorkspaces

public void clearWorkspaces()
Removes all workspace objects associated with the Map object. Example:
map.clearWorkspaces();

See Also:
addWorkspace(java.lang.Object), getWorkspaceCount(), getWorkspace(int), removeWorkspace(int)

removeWorkspace

public void removeWorkspace(int item)
Removes an associated workspace object from the Map object. Example:
map.removeWorkspace(0);

Parameters:
item - the workspace object to remove.
See Also:
clearWorkspaces(), getWorkspace(int), getWorkspaceCount(), addWorkspace(java.lang.Object)

setDataFrameName

public void setDataFrameName(String value)
If the associated ArcIMS service is an ArcMap service, this method sets the name of the dataframe to the map object. There is one map object associated with each dataframe. Example:
map.setDataFrameName("Tavaputs");

Parameters:
value - the dataframe name value
See Also:
getDataFrameName()

getDataFrameName

public String getDataFrameName()
Returns the name of the dataframe associated with this map object. There is one map object associated with each ArcMap dataframe. Example:
String dfname = map.getDataFrameName();

Returns:
String
See Also:
setDataFrameName(java.lang.String)

setConnectionProxy

public void setConnectionProxy(ConnectionProxy obj)
Sets the ConnectionProxy object associated with this map object. Example:
map.setConnectionProxy(connectionProxy);

Parameters:
obj - the ConnectionProxy object.
See Also:
getConnectionProxy()

getConnectionProxy

public ConnectionProxy getConnectionProxy()
Returns the ConnectionProxy object associated with this map object. Example:
String service = map.getConnectionProxy().getService();

Returns:
ConnectionProxy
See Also:
setConnectionProxy(com.esri.aims.mtier.io.ConnectionProxy)

getArcXML

public String getArcXML()
Returns a ArcXML String that will be built if a refresh() is called at that instance. Example:
String axlString = map.getArcXML();

Returns:
String
See Also:
sendArcXML(java.lang.String, int)

sendArcXML

public String sendArcXML(String axlString,
                         int requestType)
Sends the ArcXML string to the server based on the request type. Example:
map.sendArcXML(axlString,Map.GET_FEATURE);

Parameters:
axlString - ArcXML String value
requestType - Request type like GET_IMAGE, GET_FEATURE, GET_GEOCODE, GET_EXTRACT or GET_RASTER_INFO
Returns:
String the ArcXML Response based on the Request
See Also:
getArcXML()

getServiceInfo

public InputStream getServiceInfo()
Return the response information from ArcXML request GET_SERVICE_INFO as a InputStream

Returns:
the GET_SERVICE_INFO response

setServiceInfo

public void setServiceInfo(InputStream serviceInfo)
Set the information from ArcXML request GET_SERVICE_INFO as a InputStream

Parameters:
serviceInfo - the GET_SERVICE_INFO response

clearBuffer

public void clearBuffer()
Removes the Buffer Layer and Buffer Region layer from the layer collection. Used after buffer query.


getErrorMessage

public String getErrorMessage()
Returns the error message if there is any error in ArcXML response.

Returns:
String- the error message

getCapabilities

public Capabilities getCapabilities()
Returns the list any restrictions for an ArcIMS service.

Returns:
Capabilities- the list of restrictions for an ArcIMS Service.

setShowSwatches

public void setShowSwatches(boolean swatches)

isShowSwatches

public boolean isShowSwatches()

setTOCImageFormat

public void setTOCImageFormat(String imageFormat)

getTOCImageFormat

public String getTOCImageFormat()

setSwatchHeight

public void setSwatchHeight(int height)

getSwatchHeight

public int getSwatchHeight()

setSwatchWidth

public void setSwatchWidth(int width)

getPatchWidth

public int getPatchWidth()

setSwatchBackgroundColor

public void setSwatchBackgroundColor(String color)

getSwatchBackgroundColor

public String getSwatchBackgroundColor()

setShow

public void setShow(String show)

setUseServiceDatum

public void setUseServiceDatum(boolean useServiceDatum)

setReturnScale

public void setReturnScale(boolean returnScale)

getShow

public String getShow()

isUseServiceDatum

public boolean isUseServiceDatum()

isReturnScale

public boolean isReturnScale()

sendGetFeatureRequest

public Recordset sendGetFeatureRequest(FeatureLayer queryLayer)
Sends the GET_FEATURES request to the server based on the specified Feature layer.

Example:

 FeatureLayer fLayer = (FeatureLayer) map.getLayers().item(5);
 Filter filter = new Filter();
 filter.setWhereExpression("NAME='Gilroy'");
 filter.addSubField("#ID#");
 filter.addSubField("POP");
 filter.addSubField("NAME");
 filter.setCheckesc(true);

 fLayer.setFilterObject(filter);

 Recordset results =  map.sendGetFeatureRequest(fLayer);
 if (map.getErrorMessage() == null) {
   System.out.println("Display the results.");
 } else {
   System.out.println(map.getErrorMessage());
 }
 

Parameters:
queryLayer - the FeatureLayer object to build GET_FEATURES Request.
Returns:
the result Recordset object.