com.moximedia.aims
Class AimsMap

java.lang.Object
  extended bycom.moximedia.aims.AimsMap
All Implemented Interfaces:
java.io.Serializable

public class AimsMap
extends java.lang.Object
implements java.io.Serializable

The AimsMap class contains the complete instance of an ArcIMS map service, and modifications to the map layers, etc. that have been done during an application session. If the current state of the map is needed in subsequent pages, this object should be stored in the session object.

Author:
Doug Cates - www.moximedia.com
See Also:
Serialized Form

Field Summary
static int LAYOUT_TYPE_AI
           
static int LAYOUT_TYPE_BMP
           
static int LAYOUT_TYPE_EMF
           
static int LAYOUT_TYPE_EPS
           
static int LAYOUT_TYPE_JPG
           
static int LAYOUT_TYPE_PDF
           
static int LAYOUT_TYPE_PNG24
           
static int LAYOUT_TYPE_PNG8
           
 
Constructor Summary
AimsMap()
          Creates a new AimsMap object - note: for debugging purposes only.
AimsMap(AimsMap map)
          Creates a new map object using selected settings from another.
AimsMap(java.lang.String mapService)
          Creates a new AimsMap object with a map serviceusing the default map server (localhost) and the default ESRI servlet path of /servlet/com.esri.esrimap.Esrimap
AimsMap(java.lang.String mapServer, java.lang.String mapService)
          Creates a new AimsMap object with a mapserver name and map service, uses the default ESRI servlet path of /servlet/com.esri.esrimap.Esrimap
AimsMap(java.lang.String mapServer, java.lang.String mapService, java.lang.String mapServlet)
          Creates a new AimsMap object with a map server name, map service name, and servlet path
AimsMap(java.lang.String mapServer, java.lang.String mapService, java.lang.String mapServlet, java.lang.String mapDataFrame)
          Creates a new AimsMap object with a map server name, map service name, servlet path, and data frame name (ArcMap services only).
AimsMap(java.lang.String mapServer, java.lang.String mapService, java.lang.String mapServlet, java.lang.String mapDataFrame, java.lang.String user, java.lang.String password)
          Creates a new AimsMap object with a map server name, map service name, servlet path, data frame name (ArcMap services only), and authenticator (for ACL protected services).
AimsMap(java.lang.String mapServer, java.lang.String mapService, java.lang.String mapServlet, java.lang.String mapDataFrame, java.lang.String user, java.lang.String password, java.lang.String protocol)
          Creates a new AimsMap object with a map server name, map service name, servlet path, data frame name (ArcMap services only), and authenticator (for ACL protected services).
 
Method Summary
 void centerAt(double mapX, double mapY)
          re-centre the map at the (x,y) in map units
 void clearAlertMessage()
           
 void doZoom(double mapX, double mapY, double zoomFactor)
          Changes the extent of the map, leaving the centre point the same.
protected  int getAcetateObjectCount()
           
 int getAcetateObjectLimit()
           
protected  java.lang.String getAclPassword()
          Gets the user password for restricted services.
protected  java.lang.String getAclUser()
          Gets the user name for restricted services.
 java.lang.String getAlertMessage()
          Gets the alert message resulting from a zoom command.
 java.lang.String getAliasedUrl(java.lang.String url)
           
 java.lang.String getArcMapDataFrame()
           
 AimsColor getBackgroundColor()
          Gets the background color of the map.
 AimsColor getBackgroundTransColor()
          Gets the background transparent color of the map.
 java.lang.String getDebugComment()
           
 boolean getDrawMap()
          Gets whether the map image is created.
 AimsEnvironment getEnvironment()
          Gets the environment of the map
 AimsEnvelope getExtent()
          Gets an Envelope containg the current extent of the map in mapunits.
 AimsCoordsys getFeatureCoordsys()
          Gets the featurecoordsys for the map.
 java.lang.String getFile()
          Gets the path to the image file created by the refresh() method.
 AimsCoordsys getFilterCoordsys()
          Gets the filtercoordsys for the map.
 AimsFolders getFolders()
          Gets the AimsFolders associated with the map.
 java.lang.String getFrameworkUrlPath()
           
 AimsEnvelope getFullExtent()
          Returns an Envelope object containing the full extent of the map.
 java.lang.String getGeocodeRequestAxl()
           
 java.lang.String getGeocodeResponseAxl()
           
 int getHeight()
          Gets the height of the map in pixels.
 java.awt.image.BufferedImage getImage()
           
 java.lang.String getImageType()
          Gets the image type as indicated by the type attribute of a GET_IMAGE response.
 java.lang.String getImageUrl()
          Gets the URL of the image created by ArcIMS, unless there are also visible WMS layers, in which case this method creates a fused image and returns a URL to it.
 AimsLayerGroups getLayerGroups()
          Gets the AimsLayerGroups associated with the map.
 com.moximedia.aims.layermanager.LayerManager getLayerManager()
          Gets the layer manager object containing layers and stuff.
 AimsLayers getLayers()
          Returns the layers present in the map.
 java.lang.String getLayerUrlPath()
           
 boolean getLayout(AimsMxdTemplate template, double scale, int type)
           
 boolean getLayout(double scale, int type)
           
 boolean getLayout(java.lang.String server, java.lang.String service, java.lang.String servlet, java.lang.String dataframe, double scale, int type)
           
 java.lang.String getLayoutRequestAxl()
           
 java.lang.String getLayoutResponseAxl()
           
 java.lang.String getLayoutUrl()
           
 AimsLegend getLegend()
          Gets the Legend object associated to this map.
 java.lang.String getMapDataframe()
          Gets the dataframe associated to this map.
 java.lang.String getMapServer()
          Gets the ArcIMS server associated to this map.
 java.lang.String getMapServerProtocol()
           
 java.lang.String getMapService()
          Gets the ArcIMS service associated to this map.
 java.lang.String getMapServlet()
          Gets the ArcIMS servlet path associated to this map.
 java.awt.geom.AffineTransform getMapTransform()
          Returns an AffineTransform for use to convert page units to map units.
 java.lang.String getMapUnits()
          Returns the mapunits used in this map (eg.
 AimsEnvelope getMaximumExtent()
          Returns an Envelope object containing the maximum extent of the map.
 double getMaximumScale()
          Returns the maximum scale of the map.
 double getMinimumScale()
          Returns the minimum scale of the map.
 java.awt.geom.AffineTransform getPageTransform()
          Returns an AffineTransform for use to convert map units to page units.
 int getPrintDpi()
          Gets the print dpi for the map
 int getPrintHeight()
          Gets the print height for the map
 java.lang.String getPrintServer()
          Gets the ArcIMS server used for printing routines.
 java.lang.String getPrintService()
          Gets the ArcIMS service used for printing routines.
 double getPrintSizeMultiplier()
          Gets the printed output map size as a multiplier of the current map size.
 int getPrintWidth()
          Gets the print width for the map
 Projection getProjection()
          Gets the map projection.
 java.lang.String getRasterInfoRequestAxl()
           
 java.lang.String getRasterInfoResponseAxl()
           
 java.lang.String getRecordsetRequestAxl()
           
 java.lang.String getRecordsetResponseAxl()
           
 java.lang.String getRequestAxl()
           
 java.lang.String getResponseAxl()
           
 double getScale()
          Gets the map scale if the mapunits are metres.
 double getScale(double scaleFactor)
          Gets the map scale of a given scaleFactor if the mapunits are metres.
 double getScaleFactor()
          The mapunits per pixel map scale factor.
 double getScaleFactor(double scale)
          Gets the mapunits per pixel map scale factor for a given map scale.
 double getScaleFactor(double scale, double dpi)
          Gets the mapunits per pixel map scale factor for a given map scale and resolution.
 java.util.HashMap getServerAliases()
           
 java.lang.String getServiceInfoAxl()
           
 java.lang.Object getTag()
          Gets the user defined object tag assosciated with this object.
 java.lang.String getTempDir()
          Gets the temporary directory for image streaming.
 java.lang.String getTempUrlPath()
          Gets the temporary url path for image streaming.
 java.lang.String getUrl()
          Gets the url of the image file created by the refresh() method.
 int getWidth()
          Gets the width of the map in pixels.
 AimsWorkspaces getWorkspaces()
          Gets the workspaces added for dynamic layer support.
protected  void incrementAcetateObjectCount()
           
 boolean initMap()
          Initializes the map object with the results of the GET_SERVICE_INFO request.
 boolean isDynamic()
          Returns a boolean value indicating whether layers can be added to the map service.
 boolean isDynamicFeatures()
          Returns a boolean value indicating whether dynamic layers can be queried.
 boolean isLayerVisible(java.lang.String layerNameAliasOrId)
          Returns whether a named layer is visible (visible=true)
 boolean isLayerWithinThreshold(AimsLayer layer)
          Returns whether a named layer is within threshold tolerance.
 boolean isLayerWithinThreshold(java.lang.String layerNameAliasOrId)
          Returns whether a named layer is within threshold tolerance.
protected  AimsEnvelope popPreviousExtent()
          Gets an extent from the previous extent stack so that the zoomToPreviousExtent() method can zoom to previous extents.
 void reaspect()
          Adjusts the map extent to match the same aspect ratio as the image size.
 AimsEnvelope reaspect(AimsEnvelope env)
          Returns an extent to match the same aspect ratio as the image size.
 boolean refresh()
          Refreshes the map to produce new map and legend images.
 boolean refresh(boolean usePrintServer)
          Refreshes the map to produce new map and legend images.
 boolean refresh(boolean usePrintServer, java.util.HashSet wysiwygLayers)
          Refreshes the map to produce new map and legend images.
protected  void resetAcetateObjectCount()
           
 void setAcetateObjectLimit(int numObjects)
           
 void setAclPassword(java.lang.String password)
          Sets the user password for restricted services.
 void setAclUser(java.lang.String user)
          Sets the user name for restricted services.
 void setAxlAttribute(java.lang.String tag, java.lang.String name, java.lang.String value, java.lang.String server)
          Sets one of the attributes of this object using a string value.
 void setBackgroundColor(AimsColor color)
          Sets the background color of the map.
 void setBackgroundTransColor(AimsColor color)
          Sets the background transparent color of the map.
 void setDrawMap(boolean drawMap)
          Sets whether the map image is created.
 void setDynamic(boolean isDynamic)
          Sets whether the map supports dynamic layers.
 void setDynamicFeatures(boolean isDynamicFeatures)
          Sets whether the map supports querying of dynamic layers.
 void setEnvironment(AimsEnvironment env)
          Sets the environment of the map
 void setExtent(AimsEnvelope env)
          Sets the current extent of the map (mapunits).
 void setExtentNoAdjustment(AimsEnvelope env)
           
 void setExtentNoClip(AimsEnvelope env)
          Sets the current extent of the map (mapunits) without clipping to the maximum extent.
 void setFeatureCoordsys(AimsCoordsys coordsys)
          Sets the featurecoordsys for the map.
 void setFile(java.lang.String file)
          Sets the url of the image response.
 void setFilterCoordsys(AimsCoordsys coordsys)
          Sets the filtercoordsys for the map.
 void setFolders(AimsFolders folders)
          Sets the folders associated with this map.
 void setFrameworkUrlPath(java.lang.String frameworkPath)
           
 void setFullExtent(AimsEnvelope env)
          Sets the full extent of the map.
protected  void setGeocodeRequestAxl(java.lang.String request)
           
protected  void setGeocodeResponseAxl(java.lang.String response)
           
 void setHeight(int height)
          Sets the height of the map in pixels.
 void setInitialExtent(AimsEnvelope env)
          Sets the initial extent of the map.
protected  void setLayerGroups(AimsLayerGroups groups)
          Sets the layer groups associated with this map.
 void setLayerManager(com.moximedia.aims.layermanager.LayerManager layerManager)
          Sets the layer manager object containing layers and stuff.
 void setLayerUrlPath(java.lang.String layerPath)
           
 void setLayoutUrl(java.lang.String url)
           
 void setLegend(AimsLegend legend)
          Sets the Legend object associated to this map.
 void setMapServerProtocol(java.lang.String protocol)
           
 void setMapUnits(java.lang.String mapunits)
          Sets the mapunits used in this map (eg.
 void setMaximumExtent(AimsEnvelope env)
          Sets the maximum extent of the map.
 void setMaximumScale(double scale)
           
 void setMinimumScale(double scale)
           
 void setPrintServer(java.lang.String host)
          Sets the ArcIMS server used for printing routines.
 void setPrintService(java.lang.String service)
          Sets the ArcIMS service used for printing routines.
 void setPrintSizeMultiplier(double factor)
          Sets the printed output map size as a multiplier of the current map size.
 void setProjection(Projection projection)
          Sets the map projection.
protected  void setRasterInfoRequestAxl(java.lang.String request)
           
protected  void setRasterInfoResponseAxl(java.lang.String response)
           
protected  void setRecordsetRequestAxl(java.lang.String request)
           
protected  void setRecordsetResponseAxl(java.lang.String response)
           
protected  void setRequestAxl(java.lang.String request)
           
protected  void setResponseAxl(java.lang.String response)
           
 void setScale(double scale)
          Sets the map to the specified scale
 void setServerAlias(java.lang.String host, java.lang.String alias)
           
 void setTag(java.lang.Object tag)
          Sets the user defined object associated to this object.
 void setTempDir(java.lang.String dir)
          Sets the temporary directory for image streaming.
 void setTempUrlPath(java.lang.String path)
          Sets the temporary path for image streaming.
 void setUrl(java.lang.String url)
          Sets the url of the image response.
 void setWidth(int width)
          Sets the width of the map in pixels.
 AimsPoint toMapPoint(AimsPoint pagePoint)
          Gets the map position for the specified page position.
 AimsPoint toPagePoint(AimsPoint mapPoint)
          Gets the page coordinate for the specified map coordinate.
 java.lang.String toString()
          Returns a text representation of of this class.
 void zoomToBC()
          Sets the map extent to the extent of the province of British Columbia.
 void zoomToExtent(double x1, double y1, double x2, double y2)
          Sets the map extent to user coordinates.
 void zoomToFullExtent()
          Sets the map extent to the original extent as read from the map service.
 void zoomToMapsheet(java.lang.String mapsheet)
          Sets the map extent to the extent of a mapsheet.
 void zoomToPreviousExtent()
          Sets the map extent to an extent from the previous extent stack, and removes the extent from the stack.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LAYOUT_TYPE_AI

public static final int LAYOUT_TYPE_AI
See Also:
Constant Field Values

LAYOUT_TYPE_BMP

public static final int LAYOUT_TYPE_BMP
See Also:
Constant Field Values

LAYOUT_TYPE_EMF

public static final int LAYOUT_TYPE_EMF
See Also:
Constant Field Values

LAYOUT_TYPE_EPS

public static final int LAYOUT_TYPE_EPS
See Also:
Constant Field Values

LAYOUT_TYPE_JPG

public static final int LAYOUT_TYPE_JPG
See Also:
Constant Field Values

LAYOUT_TYPE_PDF

public static final int LAYOUT_TYPE_PDF
See Also:
Constant Field Values

LAYOUT_TYPE_PNG8

public static final int LAYOUT_TYPE_PNG8
See Also:
Constant Field Values

LAYOUT_TYPE_PNG24

public static final int LAYOUT_TYPE_PNG24
See Also:
Constant Field Values
Constructor Detail

AimsMap

public AimsMap(AimsMap map)
Creates a new map object using selected settings from another. This constructor is used with the layer manager routine that uses a fully populated map object in the application object.

Parameters:
map - The other map object.

AimsMap

public AimsMap()
Creates a new AimsMap object - note: for debugging purposes only.


AimsMap

public AimsMap(java.lang.String mapService)
Creates a new AimsMap object with a map serviceusing the default map server (localhost) and the default ESRI servlet path of /servlet/com.esri.esrimap.Esrimap

Parameters:
mapService - The name of the map service used by this map.

AimsMap

public AimsMap(java.lang.String mapServer,
               java.lang.String mapService)
Creates a new AimsMap object with a mapserver name and map service, uses the default ESRI servlet path of /servlet/com.esri.esrimap.Esrimap

Parameters:
mapServer - The name or IP address of the map server.
mapService - The name of the map service used by this map.

AimsMap

public AimsMap(java.lang.String mapServer,
               java.lang.String mapService,
               java.lang.String mapServlet)
Creates a new AimsMap object with a map server name, map service name, and servlet path

Parameters:
mapServer - The name or IP address of the map server.
mapService - The name of the map service used by this map.
mapServlet - The path of the map servlet.

AimsMap

public AimsMap(java.lang.String mapServer,
               java.lang.String mapService,
               java.lang.String mapServlet,
               java.lang.String mapDataFrame)
Creates a new AimsMap object with a map server name, map service name, servlet path, and data frame name (ArcMap services only).

Parameters:
mapServer - The name or IP address of the map server.
mapService - The name of the map service used by this map.
mapServlet - The path of the map servlet.
mapDataFrame - The data frame name in the ArcMap service.

AimsMap

public AimsMap(java.lang.String mapServer,
               java.lang.String mapService,
               java.lang.String mapServlet,
               java.lang.String mapDataFrame,
               java.lang.String user,
               java.lang.String password)
Creates a new AimsMap object with a map server name, map service name, servlet path, data frame name (ArcMap services only), and authenticator (for ACL protected services).

Parameters:
mapServer - The name or IP address of the map server.
mapService - The name of the map service used by this map.
mapServlet - The path of the map servlet.
mapDataFrame - The data frame name in the ArcMap service.
user - The user name for ACL protected services.
password - The user password for ACL protected services.

AimsMap

public AimsMap(java.lang.String mapServer,
               java.lang.String mapService,
               java.lang.String mapServlet,
               java.lang.String mapDataFrame,
               java.lang.String user,
               java.lang.String password,
               java.lang.String protocol)
Creates a new AimsMap object with a map server name, map service name, servlet path, data frame name (ArcMap services only), and authenticator (for ACL protected services).

Parameters:
mapServer - The name or IP address of the map server.
mapService - The name of the map service used by this map.
mapServlet - The path of the map servlet.
mapDataFrame - The data frame name in the ArcMap service.
user - The user name for ACL protected services.
password - The user password for ACL protected services.
protocol - The AXL request protocol, either "http" or "https".
Method Detail

getLayoutUrl

public java.lang.String getLayoutUrl()

setLayoutUrl

public void setLayoutUrl(java.lang.String url)

getLayout

public boolean getLayout(double scale,
                         int type)

getLayout

public boolean getLayout(AimsMxdTemplate template,
                         double scale,
                         int type)

getLayout

public boolean getLayout(java.lang.String server,
                         java.lang.String service,
                         java.lang.String servlet,
                         java.lang.String dataframe,
                         double scale,
                         int type)

reaspect

public AimsEnvelope reaspect(AimsEnvelope env)
Returns an extent to match the same aspect ratio as the image size.

Returns:
The envelope adjusted to fit the aspect ratio of the map.

reaspect

public void reaspect()
Adjusts the map extent to match the same aspect ratio as the image size.


getTempDir

public java.lang.String getTempDir()
Gets the temporary directory for image streaming.

Returns:
The name of the temporary directory, or null if one isn't defined.

setTempDir

public void setTempDir(java.lang.String dir)
Sets the temporary directory for image streaming.

Parameters:
dir - The name of the temporary directory.

getTempUrlPath

public java.lang.String getTempUrlPath()
Gets the temporary url path for image streaming.

Returns:
The name of the temporary path, or null if one isn't defined.

setTempUrlPath

public void setTempUrlPath(java.lang.String path)
Sets the temporary path for image streaming.

Parameters:
path - The name of the temporary path.

getAclUser

protected java.lang.String getAclUser()
Gets the user name for restricted services.

Returns:
The user name.

setAclUser

public void setAclUser(java.lang.String user)
Sets the user name for restricted services.

Parameters:
user - The user name.

getAclPassword

protected java.lang.String getAclPassword()
Gets the user password for restricted services.

Returns:
The user password.

setAclPassword

public void setAclPassword(java.lang.String password)
Sets the user password for restricted services.


getFeatureCoordsys

public AimsCoordsys getFeatureCoordsys()
Gets the featurecoordsys for the map.

Returns:
The coordsys, or null if not set.

getFilterCoordsys

public AimsCoordsys getFilterCoordsys()
Gets the filtercoordsys for the map.

Returns:
The coordsys, or null if not set.

setFeatureCoordsys

public void setFeatureCoordsys(AimsCoordsys coordsys)
Sets the featurecoordsys for the map.


setFilterCoordsys

public void setFilterCoordsys(AimsCoordsys coordsys)
Sets the filtercoordsys for the map.


getArcMapDataFrame

public java.lang.String getArcMapDataFrame()

setEnvironment

public void setEnvironment(AimsEnvironment env)
Sets the environment of the map

Parameters:
env - The environment object for this map.

getEnvironment

public AimsEnvironment getEnvironment()
Gets the environment of the map

Returns:
The environment object for this map.

getLayerUrlPath

public java.lang.String getLayerUrlPath()

setLayerUrlPath

public void setLayerUrlPath(java.lang.String layerPath)

getFrameworkUrlPath

public java.lang.String getFrameworkUrlPath()

setFrameworkUrlPath

public void setFrameworkUrlPath(java.lang.String frameworkPath)

setDrawMap

public void setDrawMap(boolean drawMap)
Sets whether the map image is created. If false, only the legend image will be created.

Parameters:
drawMap - True if the map image should be created, otherwise false.

getDrawMap

public boolean getDrawMap()
Gets whether the map image is created. If false, only the legend image will be created.

Returns:
True if the map image should be created, otherwise false.

isDynamic

public boolean isDynamic()
Returns a boolean value indicating whether layers can be added to the map service.

Returns:
True if layers can be added, otherwise false.

isDynamicFeatures

public boolean isDynamicFeatures()
Returns a boolean value indicating whether dynamic layers can be queried.

Returns:
True if dynamic layers can be queried, otherwise false.

getProjection

public Projection getProjection()
Gets the map projection.

Returns:
The map projection.

setProjection

public void setProjection(Projection projection)
Sets the map projection.

Parameters:
projection - The projection.

popPreviousExtent

protected AimsEnvelope popPreviousExtent()
Gets an extent from the previous extent stack so that the zoomToPreviousExtent() method can zoom to previous extents.

Returns:
An AimsEnvelope containing a saved extent.

setRequestAxl

protected void setRequestAxl(java.lang.String request)

setResponseAxl

protected void setResponseAxl(java.lang.String response)

setGeocodeRequestAxl

protected void setGeocodeRequestAxl(java.lang.String request)

getGeocodeRequestAxl

public java.lang.String getGeocodeRequestAxl()

setGeocodeResponseAxl

protected void setGeocodeResponseAxl(java.lang.String response)

getGeocodeResponseAxl

public java.lang.String getGeocodeResponseAxl()

setRasterInfoRequestAxl

protected void setRasterInfoRequestAxl(java.lang.String request)

getRasterInfoRequestAxl

public java.lang.String getRasterInfoRequestAxl()

setRasterInfoResponseAxl

protected void setRasterInfoResponseAxl(java.lang.String response)

getRasterInfoResponseAxl

public java.lang.String getRasterInfoResponseAxl()

getLayoutRequestAxl

public java.lang.String getLayoutRequestAxl()

getLayoutResponseAxl

public java.lang.String getLayoutResponseAxl()

setRecordsetRequestAxl

protected void setRecordsetRequestAxl(java.lang.String request)

getRecordsetRequestAxl

public java.lang.String getRecordsetRequestAxl()

setRecordsetResponseAxl

protected void setRecordsetResponseAxl(java.lang.String response)

getRecordsetResponseAxl

public java.lang.String getRecordsetResponseAxl()

getRequestAxl

public java.lang.String getRequestAxl()

getServiceInfoAxl

public java.lang.String getServiceInfoAxl()

getResponseAxl

public java.lang.String getResponseAxl()

setBackgroundColor

public void setBackgroundColor(AimsColor color)
Sets the background color of the map. Defaults to white.

Parameters:
color - The background color of the map.

setBackgroundTransColor

public void setBackgroundTransColor(AimsColor color)
Sets the background transparent color of the map.

Parameters:
color - The background transparent color of the map.

getBackgroundColor

public AimsColor getBackgroundColor()
Gets the background color of the map.

Returns:
The background color of the map.

getBackgroundTransColor

public AimsColor getBackgroundTransColor()
Gets the background transparent color of the map.

Returns:
The background transparent color of the map or null if it isn't set.

getFolders

public AimsFolders getFolders()
Gets the AimsFolders associated with the map. The folders object contains a list of AimsFolder objects which contain map layers. The folders are initialized from an XML file.

Returns:
The AimsFolders object for the map.

setFolders

public void setFolders(AimsFolders folders)
Sets the folders associated with this map.

Returns:
folders An AimsFolders object to apply to this map.

getLayerGroups

public AimsLayerGroups getLayerGroups()
Gets the AimsLayerGroups associated with the map.

Returns:
The AimsLayerGroups object for the map.

setLayerGroups

protected void setLayerGroups(AimsLayerGroups groups)
Sets the layer groups associated with this map.

Returns:
layerGroup An AimsLayerGroups object to apply to this map.

getTag

public java.lang.Object getTag()
Gets the user defined object tag assosciated with this object.

Returns:
A programmer defined object that is associated with this object using the setTag() method. Note that this request returns an Object that must be cast to the appropriate object type before using.

setTag

public void setTag(java.lang.Object tag)
Sets the user defined object associated to this object. The programmer may associate any object to this one using this method, but must cast the object to an Object class before calling this method.

Parameters:
tag - Any Object.

getPrintServer

public java.lang.String getPrintServer()
Gets the ArcIMS server used for printing routines. If the print server is null, the normal map server will be used.

Returns:
The server used by this map for print requests.

setPrintServer

public void setPrintServer(java.lang.String host)
Sets the ArcIMS server used for printing routines. If the print server is null, the normal map server will be used.

Parameters:
host - The server used by this map for print requests.

getPrintService

public java.lang.String getPrintService()
Gets the ArcIMS service used for printing routines. If the print service is null, the normal map service will be used.

Returns:
The service used by this map for print requests.

setPrintService

public void setPrintService(java.lang.String service)
Sets the ArcIMS service used for printing routines. If the print service is null, the normal map service will be used.

Parameters:
service - The service used by this map for print requests.

getMapServer

public java.lang.String getMapServer()
Gets the ArcIMS server associated to this map.

Returns:
The server used by this map.

getMapServerProtocol

public java.lang.String getMapServerProtocol()

setMapServerProtocol

public void setMapServerProtocol(java.lang.String protocol)

getMapService

public java.lang.String getMapService()
Gets the ArcIMS service associated to this map.

Returns:
The service used by this map.

getMapServlet

public java.lang.String getMapServlet()
Gets the ArcIMS servlet path associated to this map.

Returns:
The servlet path used by this map.

getMapDataframe

public java.lang.String getMapDataframe()
Gets the dataframe associated to this map.

Returns:
The dataframe used by this map.

getLegend

public AimsLegend getLegend()
Gets the Legend object associated to this map.

Returns:
The Legend object associated to this map.

setLegend

public void setLegend(AimsLegend legend)
Sets the Legend object associated to this map.

Parameters:
legend - The Legend object associated to this map.

getUrl

public java.lang.String getUrl()
Gets the url of the image file created by the refresh() method.

Returns:
The url to the last image file created by the refresh() method

getImageType

public java.lang.String getImageType()
Gets the image type as indicated by the type attribute of a GET_IMAGE response.

Returns:
The image type, or null.

setUrl

public void setUrl(java.lang.String url)
Sets the url of the image response. This is used by the parser when retrieving streamed images.

Parameters:
url - The URL to the image.

setFile

public void setFile(java.lang.String file)
Sets the url of the image response. This is used by the parser when retrieving streamed images.

Parameters:
file - The file of the image.

getFile

public java.lang.String getFile()
Gets the path to the image file created by the refresh() method.

Returns:
The path to the last image file created by the refresh() method

getDebugComment

public java.lang.String getDebugComment()

initMap

public boolean initMap()
Initializes the map object with the results of the GET_SERVICE_INFO request. Returns true if the operation is successful.

Returns:
true if successful, otherwise false.

setPrintSizeMultiplier

public void setPrintSizeMultiplier(double factor)
Sets the printed output map size as a multiplier of the current map size. Used for printing higher resolution maps.

Parameters:
factor - The multiplier, e.g. 1.5 makes a map 1.5 times the size.

getPrintSizeMultiplier

public double getPrintSizeMultiplier()
Gets the printed output map size as a multiplier of the current map size. Used for printing higher resolution maps.

Returns:
The multiplier, e.g. 1.5 makes a map 1.5 times the size.

getPrintHeight

public int getPrintHeight()
Gets the print height for the map

Returns:
The print height of the map.

getPrintWidth

public int getPrintWidth()
Gets the print width for the map

Returns:
The print width of the map.

getPrintDpi

public int getPrintDpi()
Gets the print dpi for the map

Returns:
The print dpi of the map.

refresh

public boolean refresh()
Refreshes the map to produce new map and legend images.

Returns:
True if the operation was successful, otherwise false.

refresh

public boolean refresh(boolean usePrintServer)
Refreshes the map to produce new map and legend images.

Parameters:
usePrintServer - True if the alternate print server should be used.
Returns:
True if the operation was successful, otherwise false.

refresh

public boolean refresh(boolean usePrintServer,
                       java.util.HashSet wysiwygLayers)
Refreshes the map to produce new map and legend images.

Parameters:
usePrintServer - True if the alternate print server should be used.
wysiwygLayers - A list of layers object ids to draw (Integer), regardless of settings.
Returns:
True if the operation was successful, otherwise false.

getAlertMessage

public java.lang.String getAlertMessage()
Gets the alert message resulting from a zoom command. If the zoom is not possible or is adjusted by the clipToMaximumExtent() method, this method returns a message string, otherwise it returns an empty string.

Returns:
A message to show the user.

clearAlertMessage

public void clearAlertMessage()

setExtent

public void setExtent(AimsEnvelope env)
Sets the current extent of the map (mapunits).

Parameters:
env - An Envelope containing the new extent.

setExtentNoAdjustment

public void setExtentNoAdjustment(AimsEnvelope env)

setExtentNoClip

public void setExtentNoClip(AimsEnvelope env)
Sets the current extent of the map (mapunits) without clipping to the maximum extent.

Parameters:
env - An Envelope containing the new extent.

getExtent

public AimsEnvelope getExtent()
Gets an Envelope containg the current extent of the map in mapunits.

Returns:
The current map extent Envelope.

getWidth

public int getWidth()
Gets the width of the map in pixels.

Returns:
The width of the map in pixels.

getWorkspaces

public AimsWorkspaces getWorkspaces()
Gets the workspaces added for dynamic layer support.

Returns:
The workspaces object.

setWidth

public void setWidth(int width)
Sets the width of the map in pixels.

Parameters:
width - The width of the map in pixels.

getHeight

public int getHeight()
Gets the height of the map in pixels.

Returns:
The height of the map in pixels.

setHeight

public void setHeight(int height)
Sets the height of the map in pixels.

Parameters:
height - The height of the map in pixels.

setFullExtent

public void setFullExtent(AimsEnvelope env)
Sets the full extent of the map.

Parameters:
env - The map extent envelope

setInitialExtent

public void setInitialExtent(AimsEnvelope env)
Sets the initial extent of the map.

Parameters:
env - The map extent envelope

getFullExtent

public AimsEnvelope getFullExtent()
Returns an Envelope object containing the full extent of the map.

Returns:
An Envelope object containing the full extent of the map.

getMapUnits

public java.lang.String getMapUnits()
Returns the mapunits used in this map (eg. meters, feet, etc)..

Returns:
A String containing the type of mapunits.

setMapUnits

public void setMapUnits(java.lang.String mapunits)
Sets the mapunits used in this map (eg. meters, feet, etc)..

Parameters:
mapunits - A String containing the type of mapunits.

setMaximumExtent

public void setMaximumExtent(AimsEnvelope env)
Sets the maximum extent of the map.

Parameters:
env - The map extent envelope

getMaximumExtent

public AimsEnvelope getMaximumExtent()
Returns an Envelope object containing the maximum extent of the map.

Returns:
An Envelope object containing the maximum extent of the map, or null if the maximum extent is not defined.

getMaximumScale

public double getMaximumScale()
Returns the maximum scale of the map.

Returns:
The maximum scale of the map.

getMinimumScale

public double getMinimumScale()
Returns the minimum scale of the map.

Returns:
The minimum scale of the map.

getLayers

public AimsLayers getLayers()
Returns the layers present in the map.

Returns:
A Layers object containing the map layers.

isLayerWithinThreshold

public boolean isLayerWithinThreshold(java.lang.String layerNameAliasOrId)
Returns whether a named layer is within threshold tolerance.

Parameters:
layerNameAliasOrId - name, alias or ID of the layer
Returns:
True if the layer is shown at the present scale, otherwise false.

isLayerWithinThreshold

public boolean isLayerWithinThreshold(AimsLayer layer)
Returns whether a named layer is within threshold tolerance.

Returns:
True if the layer is shown at the present scale, otherwise false.

isLayerVisible

public boolean isLayerVisible(java.lang.String layerNameAliasOrId)
Returns whether a named layer is visible (visible=true)

Parameters:
layerNameAliasOrId - name or ID of the layer
Returns:
true if layer is visible, otherwise false.

zoomToBC

public void zoomToBC()
Sets the map extent to the extent of the province of British Columbia.


zoomToFullExtent

public void zoomToFullExtent()
Sets the map extent to the original extent as read from the map service.


zoomToExtent

public void zoomToExtent(double x1,
                         double y1,
                         double x2,
                         double y2)
Sets the map extent to user coordinates.

Parameters:
x1 - The minimum X coordinate (mapunits)
y1 - The minimum Y coordinate (mapunits)
x2 - The maximum X coordinate (mapunits)
y2 - The maximum Y coordinate (mapunits)

zoomToPreviousExtent

public void zoomToPreviousExtent()
Sets the map extent to an extent from the previous extent stack, and removes the extent from the stack.


zoomToMapsheet

public void zoomToMapsheet(java.lang.String mapsheet)
Sets the map extent to the extent of a mapsheet.

Parameters:
mapsheet - The mapsheet to zoom to

getScale

public double getScale(double scaleFactor)
Gets the map scale of a given scaleFactor if the mapunits are metres. The scaleFactor is the pixels per metre for metric sources. The ESRI threshold routines use a fixed resolution value of approximately 97.6925 pixels per inch to calculate scale when doing the thresholding.

Parameters:
scaleFactor - The scale factor to calculate map scale for.
Returns:
The map scale

getScaleFactor

public double getScaleFactor(double scale)
Gets the mapunits per pixel map scale factor for a given map scale. This value is used internally in the minscale and maxscale routines used by the server.

Parameters:
scale - The map scale to calculate a scale factor for.
Returns:
The mapunits per pixel scale factor.

getScaleFactor

public double getScaleFactor(double scale,
                             double dpi)
Gets the mapunits per pixel map scale factor for a given map scale and resolution. This value is used internally in the minscale and maxscale routines used by the server.

Parameters:
scale - The map scale to calculate a scale factor for.
dpi - The screen resolution.
Returns:
The mapunits per pixel scale factor.

getScale

public double getScale()
Gets the map scale if the mapunits are metres.

Returns:
The map scale

getScaleFactor

public double getScaleFactor()
The mapunits per pixel map scale factor. This value is used internally in the minscale and maxscale routines used by the server.

Returns:
The mapunits per pixel scale factor.

setScale

public void setScale(double scale)
Sets the map to the specified scale

Parameters:
scale - The scale. For example 20000 indicates that the scale should be set to 1:20000.

doZoom

public void doZoom(double mapX,
                   double mapY,
                   double zoomFactor)
Changes the extent of the map, leaving the centre point the same. If the zoomFactor is less than 1.0, the map will zoom in, otherwise it will zoom out. For example, a zoomFactor of 2.0 will zoom out 2 times, a zoom factor of 0.5 will zoom in 2 times, and a zoomFactor of 1.0 will not zoom at all.

Parameters:
mapX - The map centre x coordinate.
zoomFactor - A number that determines the relative scale for the map.

centerAt

public void centerAt(double mapX,
                     double mapY)
re-centre the map at the (x,y) in map units

Parameters:
mapX - centre point x coordinate, in mapunits
mapY - centre point y coordinate, in mapunits

setAxlAttribute

public void setAxlAttribute(java.lang.String tag,
                            java.lang.String name,
                            java.lang.String value,
                            java.lang.String server)
Sets one of the attributes of this object using a string value. This method can only be called from the SAX event handler.

Parameters:
tag - The AXL element tag containing this attribute.
name - The AXL attribute name.
value - The AXL attribute value.

toMapPoint

public AimsPoint toMapPoint(AimsPoint pagePoint)
Gets the map position for the specified page position.

Parameters:
pagePoint - The page position.
Returns:
The map position.

toPagePoint

public AimsPoint toPagePoint(AimsPoint mapPoint)
Gets the page coordinate for the specified map coordinate.

Parameters:
mapPoint - The map coordinate.
Returns:
The page coordinate.

toString

public java.lang.String toString()
Returns a text representation of of this class.

Returns:
A string describing the class

setMaximumScale

public void setMaximumScale(double scale)

setMinimumScale

public void setMinimumScale(double scale)

getMapTransform

public java.awt.geom.AffineTransform getMapTransform()
Returns an AffineTransform for use to convert page units to map units.

Returns:
An AffineTransform for use to convert page units to map units.

getPageTransform

public java.awt.geom.AffineTransform getPageTransform()
Returns an AffineTransform for use to convert map units to page units.

Returns:
An AffineTransform for use to convert map units to page units.

getImage

public java.awt.image.BufferedImage getImage()

getImageUrl

public java.lang.String getImageUrl()
Gets the URL of the image created by ArcIMS, unless there are also visible WMS layers, in which case this method creates a fused image and returns a URL to it.

Returns:
The url to the ArcIMS of fused image.

getLayerManager

public com.moximedia.aims.layermanager.LayerManager getLayerManager()
Gets the layer manager object containing layers and stuff.

Returns:
The layer manager object.

setLayerManager

public void setLayerManager(com.moximedia.aims.layermanager.LayerManager layerManager)
Sets the layer manager object containing layers and stuff.

Parameters:
layerManager - The layer manager object.

setAcetateObjectLimit

public void setAcetateObjectLimit(int numObjects)

getAcetateObjectLimit

public int getAcetateObjectLimit()

getAcetateObjectCount

protected int getAcetateObjectCount()

incrementAcetateObjectCount

protected void incrementAcetateObjectCount()

resetAcetateObjectCount

protected void resetAcetateObjectCount()

setServerAlias

public void setServerAlias(java.lang.String host,
                           java.lang.String alias)

getServerAliases

public java.util.HashMap getServerAliases()

getAliasedUrl

public java.lang.String getAliasedUrl(java.lang.String url)

setDynamic

public void setDynamic(boolean isDynamic)
Sets whether the map supports dynamic layers.

Parameters:
isDynamic - True if the map supports dynamic layers, otherwise false.

setDynamicFeatures

public void setDynamicFeatures(boolean isDynamicFeatures)
Sets whether the map supports querying of dynamic layers.



Internet Mapping Framework for ArcIMS Java Object Model API (v5.1.00)
Copyright © 2006 Moxi Media Inc. and Province of British Columbia. All Rights Reserved.