Class MapMaker

This class is used to create a Mapx object. It can be discarded once the projection has been created.


Constructor Summary

MapMaker ( )
Create a MapMaker object

Method Summary

createMapx (1) ( filename )
Creates a Mapx object using a predefined projection definition.
createMapx (2) ( server , filename )
Creates a Mapx object by loading a predefined definition from a remote server
createMapx (3) ( projection_name , lat0 , lon0 , lat1 , lon1 , rotation , scale , center_lat , center_lon , south , north , west , east , lat_interval , lon_interval , label_lat , label_lon , cil_detail , bdy_detail , riv_detail , equatorial_radius , eccentricity )
Creates a Mapx object by loading in the necessary values manually.

Constructor Detail

MapMaker

Create a MapMaker object


Parameters
None.

Returns
A new MapMaker object ready to create Mapx objects.

Examples
var mm = new MapMaker();
// Creates a new MapMaker object.

Notes
No initialization needs to be done. This class is primarily for the purpose of making Mapx generation a little easier.

Method Detail

createMapx (1)

Creates a Mapx object using a predefined projection definition.


Parameters
filename - The "filename" of the built-in projection definition.

Returns
A Mapx projection object (or null if there were errors)

Examples
var mx = mm.createMapx('East.mpp');
// Generates a Mapx object based on the East.mpp definition

Notes
See the mapx_definitions.txt file for a list of pre-defined Mapx projection definitions.


createMapx (2)

Creates a Mapx object by loading a predefined definition from a remote server


Parameters
server - The server and path to the file to load
filename - The name of the actual definition file

Returns
A Mapx projection defined by the file given

Examples
var mx = mm.createMapx('http://someserver.com/path/', 'def.mpp');
// Leads the file at http://someserver.com/path/def.mpp, and
// creates a Mapx object based on the definition in the file

Notes
This method uses AJAX to load the file, so browsers that do not support AJAX will not load the definition. See the mapx_definitions.txt file for information on the details of how the definition must be formatted. The server and filename must be given as two variables to make it easier for the JavaScript to know how to distinguish between this and createMapx (1) above.


createMapx (3)

Creates a Mapx object by loading in the necessary values manually.


Parameters
projection_name - The name of the projection to use
lat0 - lat0 value used by the projection (*)
lon0 - lon0 value used by the projection (*)
lat1 - lat1 value used by the projection (*)
lon1 - lon1 value used by the projection (*)
rotation - The rotation angle to use
scale - The scale factor to use
center_lat - The latitude of the map center
center_lon - The longitude of the map center
// NOTE: these aren't necessarily the same
// as the PROJECTION center, but merely the
// center of the map's coordinates
south - The southernmost limit of the projection
north - The northernmost limit of the projection
west - The westernmost limit of the projection
east - The easternmost limit of the projection
lat_interval - The latitude interval (**)
lon_interval - The longitude interval (**)
label_lat - The label for latitude (**)
label_lon - The label for longitude (**)
cil_detail - 1 or 0, represents Coastline/Island/Lake (**)
bdy_detail - 1 or 0, represents political boundaries (**)
riv_detail - 1 or 0, represents rivers (**)
equatorial_radius - Optional radius of the equator
eccentricity - Optional eccentricity for ellipse projections

Returns
A Mapx projection defined by the information given.

Examples
var mx = mm.createMapx('Azimuthal Equal-Area', 90, 0, 0, 0,
0, 1, 90, 0, 0, 90, -180, 180, 15, 30, 0, 0,
0, 0, 1, 6371228.0, 0);
// Creates a Mapx object using the Azimuthal Equal-Area projection
// and the parameters given above.

Notes
The values marked with (**) are not currently utilized by this version of Mapx, but represent values that may be useful in future applications. They are used for display purposes, not calculation purposes. It is possible in future versions that these values may be removed, though if this happens tis version will still be available for backwards compatibility. equatorial_radius is optional. If it is not provided, a default value of 6371.228 is used. eccentricity is optional, and only used for projections that use an elliptical earth. If so, and the value is not provided, a default value of 0.082271673 is used. The projection name must conform to the list found in the mapx_projections.txt file. The parameters marked as (*) above are specific to the projections. Some projections may not use certain values, in which case any value can be used as a place- holder for those values The south boundary cannot be greater than the north boundary. However, the west boundary may be greater than the east boundary. If so, this will mean the map boundaries straddle the dateline.