|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object | +--Mapserv
This is the basic Mapserv class.
Defined in mapserv.js
Field Summary | |
Double |
cellsize
calculated length of a pixel side in map units. |
Array |
defaultextent
the extent that was passed to this Mapserv instance at construction. |
Object |
drawHandler
|
Array |
extent
a four-member array of Doubles defining the rectangular extent of the map (in map coordinates). |
Integer |
height
the height of the map image (in pixels). |
Float |
inchesPerMapUnit
number of inches in the current map unit. |
Array |
layers
an associative array of layer status, keyed by layer name; values are booleans. |
String |
mapfile
the MapServer configuration file for map draws. |
String |
mapserver
the url for the MapServer executable that will create maps. |
Integer |
maxscale
maximum scale to allow for map draws. |
Integer |
minscale
minimum scale to allow for map draws. |
String |
mode
mode in which the MapServer executable will be called. |
String |
options
a url query string ("&this=that&some=other") used to pass any application-specific options for a map draw operation that are not covered in the draw() method. |
Float |
pansize
amount by which to move the map in automatic pan operations. |
Integer |
pixelsPerInch
a value used in scale calculations. |
Array |
point
a two-member array of Doubles defining a point of interest (in map coordinates) to the current operation (typically from a user's mouse click). |
Array |
queryextent
a four-member array of Doubles defining a rectangular extent (in map coordinates) for a query operation. |
String |
queryfile
the MapServer configuration file for query operations. |
Object |
queryHandler
|
String |
queryoptions
a url query string ("&this=that&some=other") used to store any application-specific options for a query operation that are not covered in the query() method. |
Array |
querypoint
a two-member array of Doubles defining a point of interest (in image coordinates) to the current query operation (typically from a user's mouse click). |
String |
queryserver
the url for the MapServer executable that will handle queries. |
Mapserv |
referencemap
a reference map object. |
String |
url
a complete url for a map draw or query operation. |
Integer |
width
the width of the map image (in pixels). |
Integer |
zoomdir
direction of zoom. |
Object |
zoomsize
the zoom factor to be applied on zoom-in operations (the inverse is taken for zoom-out operations). |
Constructor Summary | |
Mapserv
(<String> mapserver, <String> mapfile, <Double> minx, <Double> miny, <Double> maxx, <Double> maxy, <Integer> width, <Integer> height)
Construct a new Mapserv object. |
Method Summary | |
void
|
applyBox(<Integer> minx, <Integer> miny, <Integer> maxx, <Integer> maxy)
convert a box defined in image coordinates to an extent defined in map coordinates and store in the extent field. |
void
|
applyBoxQuery(<Integer> minx, <Integer> miny, <Integer> maxx, <Integer> maxy)
construct a four-member query extent array in image coordinates and store in the queryextent field. |
void
|
applyPointQuery(<Integer> x,<Integer> y)
construct a two-member query point array in image coordinates and store in the querypoint field. |
void
|
applyReference(<Integer> x,<Integer> y)
calculate a new map extent to be centered on an image coordinate from the reference map image, and store in the extent field. |
void
|
applyZoom(<Integer> x, <Integer> y)
calculate a new map extent based on zoomdir, zoomsize, and the passed point (in image coordinates), and store in the extent field. |
void
|
draw()
construct a pair of urls (one for the main map and one for the reference map, if applicable) using the current settings of various fields, store them in the url and referencemap.url fields, respectively, and call the drawHandler. |
String
|
getLayers(delimeter)
Get the list of currently active layers. |
Double
|
getScale()
get the nominal scale based on current settings. |
void
|
imageToMap(<Integer> x, <Integer> y)
convert an image coordinate pair to a map coordinate pair, and store in the point field. |
void
|
layersOff()
Set draw/query status for all layers to off. |
void
|
pan(<Enumerated> direction)
pan map in the given direction, using the current pansize setting. |
void
|
query()
construct a query url using the current settings of various fields, store in the url field, and call the queryHandler. |
void
|
recenter(<Double> x, <Double> y)
recenter the map at the given point, using the current scale. |
void
|
setExtent(<Double> minx, <Double> miny, <Double> maxx, <Double> maxy)
set extent using the given values. |
void
|
setExtentFromScale(<Double> x, <Double> y, <Integer> scale)
set extent centered on the given point using the given scale. |
void
|
setHandler(<Enumerated> type, <Function> handler)
set a handler function for draw/query operations. |
void
|
setLayer(<String> name, <Boolean> status)
set the draw/query status of a layer. |
void
|
setUnits(<Enumerated> type)
set the map units. |
void
|
zoomDefault()
redraw the map at the default extent. |
void
|
zoomIn(<Double> x,<Double> y)
zoom in centered on the given point, using the current zoomsize setting. |
void
|
zoomOut(<Double> x,<Double> y)
zoom out centered on the given point, using the inverse of the current zoomsize setting. |
void
|
zoomRadius(<Double> x, <Double> y, <Double> radius)
draw a new map centered on the given point, with an extent that minimally fits the circle defined by the point and supplied radius. |
void
|
zoomScale(<Double> x, <Double> y, <Integer> scale)
recenter the map at the given point, using the given scale. |
Field Detail |
Double cellsize
Array defaultextent
Object drawHandler
Array extent
Integer height
Float inchesPerMapUnit
default: 39.3701 (inches in a meter)
Array layers
String mapfile
String mapserver
Integer maxscale
value used is denominator of the representative fraction (1:x)
value of -1 indicates no maximum
Integer minscale
value used is denominator of the representative fraction (1:x)
value of -1 indicates no minimum
String mode
Valid values are map, query and nquery although it is certainly possible to create more complex queries outside of the Mapserv object.
String options
Float pansize
0 < pansize < 1
Integer pixelsPerInch
default: 72 (typical monitor resolution)
Array point
Array queryextent
String queryfile
Object queryHandler
String queryoptions
Array querypoint
String queryserver
Mapserv referencemap
String url
Integer width
Integer zoomdir
Object zoomsize
Constructor Detail |
Mapserv(<String> mapserver, <String> mapfile, <Double> minx, <Double> miny, <Double> maxx, <Double> maxy, <Integer> width, <Integer> height)
mapserver
- The url for the MapServer instance that will create maps.
mapfile
- The mapfile to be used.
minx
- The minimum x coordinate for the initial (default) map extent.
miny
- The minimum y coordinate for the initial (default) map extent.
maxx
- The maximum x coordinate for the initial (default) map extent.
maxy
- The maximum y coordinate for the initial (default) map extent.
width
- The width (in pixels) of the maps to be created.
height
- The height (in pixels) of the maps to be created.
Method Detail |
void applyBox(<Integer> minx, <Integer> miny, <Integer> maxx, <Integer> maxy)
minx
- minimum x image coordinate
miny
- minimum y image coordinate
maxx
- maximum x image coordinate
maxy
- maximum y image coordinate
void applyBoxQuery(<Integer> minx, <Integer> miny, <Integer> maxx, <Integer> maxy)
minx
- minimum x image coordinate
miny
- minimum y image coordinate
maxx
- maximum x image coordinate
maxy
- maximum y image coordinate
void applyPointQuery(<Integer> x,<Integer> y)
x
- image coordinate x value
y
- image coordinate y value
void applyReference(<Integer> x,<Integer> y)
x
- reference map image coordinate x value
y
- reference map image coordinate y value
void applyZoom(<Integer> x, <Integer> y)
x
- image coordinate x
y
- image coordinate y
void draw()
Fields/methods used in assembling the url for the main map are:
Fields/methods used in assembling the url for the reference map are:
String getLayers(delimeter)
delimiter
- the character(s) to use to delimit the returned list
Double getScale()
void imageToMap(<Integer> x, <Integer> y)
x
- the x image coordinate
y
- the y image coordinate
void layersOff()
void pan(<Enumerated> direction)
direction
- direction to pan. Specified as a lowercase abbreviation of one of the eight cardinal/primary intercardinal directions:
void query()
Fields/methods used in assembling the url are:
void recenter(<Double> x, <Double> y)
x
- map coordinate x value
y
- map coordinate y value
void setExtent(<Double> minx, <Double> miny, <Double> maxx, <Double> maxy)
minx
- minimum x coordinate
miny
- minimum y coordinate
maxx
- maximum x coordinate
maxy
- maximum y coordinate
void setExtentFromScale(<Double> x, <Double> y, <Integer> scale)
x
- map coordinate x value
y
- map coordinate y value
scale
- desired scale, given as denominator of the representative fraction (1:x)
void setHandler(<Enumerated> type, <Function> handler)
type
- constant for handler type to be set. Valid type values are: handler
- function to be called
void setLayer(<String> name, <Boolean> status)
name
- The name of the layer to set status for
status
- 0/false - off; 1/true - on
void setUnits(<Enumerated> type)
type
- constant for desired units type. Valid type values are: void zoomDefault()
void zoomIn(<Double> x,<Double> y)
x
- map coordinate x value
y
- map coordinate y value
void zoomOut(<Double> x,<Double> y)
x
- map coordinate x value
y
- map coordinate y value
void zoomRadius(<Double> x, <Double> y, <Double> radius)
x
- map coordinate x value
y
- map coordinate y value
radius
- desired distance from given point to edge of map
void zoomScale(<Double> x, <Double> y, <Integer> scale)
x
- map coordinate x value
y
- map coordinate y value
scale
- desired scale, given as denominator of the representative fraction (1:x)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |