Display your business-critical information with confidence. Vicmap™ API – authoritative, current and clear.
For the actual map object, user can put the map object inside any block level element, which pretty much covers almost any HTML element on a page.
Below is the code snippet for displaying a map with panning and zooming controls; this is considered the basic usage of Vicmap API.
5 function init()
7 // "map" corresponds to the id of the div hosting the map
8 var map = new OpenLayers.Vicmap.Map("map");
12 <body onload="init()">
13 <div id="map" style="height:400px; width:600px; border:1px solid #000000;"></div>
In the code above a basic map with panning and zooming controls is created. Explanations for relevant lines of codes are given below:
- In line 5, the OpenLayers.Vicmap.Map object is created within the
- In line 8, the "map" variable refers to the element id of the container for the map object. The OpenLayers.Vicmap.Map constructor requires one argument. The argument must be an HTML element, or the ID of an HTML element.
- In line 12, the map object is initialised upon the <body> tag's onload event
- In line 13, a <div> element with the id "map" is created as a container for the map