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.

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).
 
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  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 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()
           
 AimsLayerGroups getLayerGroups()
          Gets the AimsLayerGroups associated with the map.
 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 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.
 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
 int getPrintWidth()
          Gets the print width for the map
 AimsProjection getProjection()
           
 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.
 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.
 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 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.
 boolean refresh()
          Refreshes the map to produce new map and legend images.
 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 setEnvironment(AimsEnvironment env)
          Sets the environment of the map
 void setExtent(AimsEnvelope env)
          Sets the current extent of the map (mapunits).
 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 setLayerUrlPath(java.lang.String layerPath)
           
 void setLayoutUrl(java.lang.String url)
           
 void setLegend(AimsLegend legend)
          Sets the Legend object associated to this map.
 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 setPrintSizeMultiplier(double factor)
          Sets the printed output map size as a multiplier of the current map size.
 void setProjection(AimsProjection 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 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.
 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.
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 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.

getProjection

public AimsProjection getProjection()

setProjection

public void setProjection(AimsProjection 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.

getMapServer

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

Returns:
The server used by this map.

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.

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.

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.

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.

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. The ESRI routines use a fixed resolution value of approximately 97.6925 pixels per inch to calculate scale when doing the thresholding.

Returns:
The mapunits per pixel scale factor.

getScale

public double getScale()
Gets the map scale if the mapunits are metres. The ESRI threshold routines use a fixed resolution value of approximately 97.6925 pixels per inch to calculate scale when doing the thresholding, so this routine uses the same values.

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.

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.

getImageUrl

public java.lang.String getImageUrl()

getImage

public java.awt.image.BufferedImage getImage()