- Installation
- Placing pointMapper on a Web Page
- The pointMapper API
- Tiling
For an introduction to pointMapper, see "what is pointMapper?" nearby.
Placing pointMapper on a Web Page
The contents of the file http://www.mapbureau.com/pointmapper/examples/seattle.html are:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD><TITLE>Seattle, Washington</TITLE> <LINK href="/pointmapper/examples/seattle.css" rel=stylesheet> <!-- sets pointMapper parameters --> <script type="text/javascript" language="JavaScript"> var pm_class = "mapclass"; // style properties for the map, defined in seattle.css var pm_color = "F0F1DC"; // background color for the map swf var pm_location = "/pointmapper/2.0"; // location of the pointMapper installation </script> <!-- loads pointMapper scripts --> <script type="text/javascript" language="JavaScript" src="/pointmapper/2.0/m.js"> </script> <!-- defines loadMap() --> <script type="text/javascript" language="JavaScript" src="/pointmapper/basemaps/us/wa/seattle_1/loadmap.js"> </script> </HEAD> <BODY> <b style="margin-left:2em"><b>Seattle, Washington</b> <script type="text/javascript" language="javascript"> loadMap(); </script> </BODY> </HTML>
For more working examples of pointMapper, see the examples directory in your installation.
As illustrated by this example, pointMapper is placed in a web page by inclusion of script elements. The first element specifies parameters that control size, position, and other aspects of pointMapper instance:
<script type="text/javascript" language="JavaScript"> var pm_class = "mapclass"; // style properties for the map, defined in seattle.css var pm_color = "F0F1DC"; // background color for the map swf var pm_location = "/pointmapper/2.0"; // location of the pointMapper installation </script>The second script element performs the instantiation of pointMapper on the page:
<script type="text/javascript" language="JavaScript" src="/pointmapper/2.0/m.js"> </script>
In the above example, it is assumed that the pointMapper server kit has been installed at the server URL /pointmapper, and that version 2.0 is wanted. PointMapper can be installed anywhere on your server. Wherever it is installed, the pm_location parameter, and the src attribute of the second script element should be set accordingly, for example:
pm_location = "/myinstall/pointmapper/2.0"; .... <script type="text/javascript" language="JavaScript" src="/myinstall/pointmapper/2.0/m.js"> // loads pointMapper scripts </script>
The Map Bureau map catalog includes some maps whose imagery is contained in a single swf (Flash) file, and others that are built from multiple layers. The latter variety always includes a .js file that defines the function loadMap. In the case of Seattle, this .js file is found at /pointmapper/basemaps/us/wa/seattle_1/loadmap.js . The implementation of loadMap consists of a series of pointMapper API calls. (You are of course free to modify this code to suit the needs of your application ,eg by changing the set of layers loaded, or the zoom ranges within which they are visible). The following element loads the map into the pointMapper instance on the page:
<script type="text/javascript" language="javascript"> loadMap(); </script>
For "atomic" maps contained in a single swf, no loadmap.js is included, since the map loading is accomplished by a single line of Javascript. For example, in /pointmapper/examples/canada.html, the map is loaded with:
<script type="text/javascript" language="javascript">
pm_loadMap('/pointmapper/basemaps/canada.0.xml');
</script>
The XML file that should be used for each atomic map is specified in the catalog.
Only one instance of pointMapper may appear per page, although instances can appear in multiple frames or iframes.
A complete list of the available parameters follows:
pm_color
Specifies the background color of the map as a string of the form RRGGBB, where RR is the hexidecimal for the red intensity as a fraction of the maximum value (255, or FF hex), and GG, BB represent green and blue. Default value: "FFFFFF" (white).
pm_style
The instantiation script (m.js) produces an iframe into which the pointMapper Flash component is placed. The pm_style parameter sets the style attribute of this iframe element, and thereby controls size and placement of the map. For example,
pm_style = "position:absolute;left:470px;width:320px;top:650px;height:550px";
sets the pointMapper position and dimensions on the page to absolute values. See http://www.w3.org/TR/REC-CSS2/ for information about HTML styles; much flexibility in specifying position is available.
pm_class
The pm_class parameter sets the class attribute of the iframe element, and thereby allows control of the size and placement of the map from a style sheet rather than an in-line style. For example, the style sheet for the Manhattan map on the "what is pointMapper" page includes the definition:
.whatismap{ background-color: #ffffee;
position: absolute;
width: 320px; height: 550px;
left: 470px; top: 650px;
}
Therefore,
pm_class = "whatismap";
has the same effect as
pm_style = "position:absolute;left:470px;width:320px;top:650px;height:550px";
Typically, either pm_style or pm_class is specified, but not both.
pm_location
As explained above, pm_location gives the path to the pointMapper installation. The path may be specified relative to the page, as an absolute path within the server (eg "/myinstall/pointmapper/2.0"), or as a full URL ("http://www.myserver.com/myinstall/pointmapper/2.0").
pm_mapTitle
The string assigned to pm_mapTitle appears just above the map to the right of the viewing controls. The default value is "pointMapper" for licensed installations, or "Unlicensed Copy" if you have not purchased a pointMapper license. pm_mapTitle has no effect in unlicensed installations.
pm_identityService
If you are serving all content, including
point files and basemaps, from the same server as pointMapper, then this parameter is
not needed (this is the normal situation). However, to access XML content from other servers, you must specify
an identity script, whose effect is to support access to foreign XML via a local URL.
This script is required because of a security feature in the underlying
Macromedia Flash player, which prohibits Flash movies from loading
XML files from servers other
than the one hosting the current movie. The script identity.php is supplied with pointMapper
for this purpose. If your server supports PHP, set
pm_identityService to "identity.php". You can
write your own identity script (eg identity.py in Python), install it in the pointMapper
directory (eg
This completes the list of the parameters that appear in the first script element, prior to the pointMapper instantiation.